//	--------------------------------------------------------------------
//	Copyright(C) 2006,2007 Zhao Yukun. All rights reserved.
//	This file is a part of the Xeres system.
//	Xeres 2007
//	Contact : xeres.engine@gmail.com
//	$(reservedInfo)
//	$(reservedDeclaration)
//	--------------------------------------------------------------------
///	@file	<import_dx9.cpp>
///	@path	~/src/graphics/dx9/
///	@date	2008/09/16
///	@brief	.

#include "config/config.h"

#include "lib/utilities/debug.h"

#include "graphics/dx9/import_dx9.h"

#define	_DYNAMIC_LOAD_DX9		1

#if (!_DYNAMIC_LOAD_DX9)
//#pragma comment( linker , "/defaultlib:d3d9.lib" )
#ifdef _DEBUG
//#pragma comment( linker , "/defaultlib:d3dx9d.lib" )
#else
//#pragma comment( linker , "/defaultlib:d3dx9.lib" )
#endif
#endif

namespace xeres {

	namespace dx9
	{
		namespace fn
		{
			/// \name DirectX 3D 9
			//@{
			static HMODULE s_hDirect3D9Module = NULL;
			
			IDirect3D9 * (WINAPI *Direct3DCreate9)(UINT SDKVersion) = NULL;

			int (WINAPI *D3DPERF_BeginEvent)( D3DCOLOR col, LPCWSTR wszName ) = NULL;
			int (WINAPI *D3DPERF_EndEvent)( void ) = NULL;
			void (WINAPI *D3DPERF_SetMarker)( D3DCOLOR col, LPCWSTR wszName ) = NULL;
			void (WINAPI *D3DPERF_SetRegion)( D3DCOLOR col, LPCWSTR wszName ) = NULL;
			BOOL (WINAPI *D3DPERF_QueryRepeatFrame)( void ) = NULL;

			void (WINAPI *D3DPERF_SetOptions)( DWORD dwOptions ) = NULL;
			DWORD (WINAPI *D3DPERF_GetStatus)( void ) = NULL;

			//@}

			/// \name DirectX 3D X 9
			//@{
			static HMODULE s_hDirect3DX9Module = NULL;


			// Converts an array 32-bit floats to 16-bit floats
			D3DXFLOAT16* (WINAPI *D3DXFloat32To16Array)( D3DXFLOAT16 *pOut, CONST FLOAT *pIn, UINT n ) = NULL;
			// Converts an array 16-bit floats to 32-bit floats
			FLOAT* (WINAPI *D3DXFloat16To32Array)( FLOAT *pOut, CONST D3DXFLOAT16 *pIn, UINT n ) = NULL;


			D3DXVECTOR2* (WINAPI *D3DXVec2Normalize)
				( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV ) = NULL;

			// Hermite interpolation between position V1, tangent T1 (when s == 0)
			// and position V2, tangent T2 (when s == 1).
			D3DXVECTOR2* (WINAPI *D3DXVec2Hermite)
				( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pT1,
				CONST D3DXVECTOR2 *pV2, CONST D3DXVECTOR2 *pT2, FLOAT s ) = NULL;

			// CatmullRom interpolation between V1 (when s == 0) and V2 (when s == 1)
			D3DXVECTOR2* (WINAPI *D3DXVec2CatmullRom)
				( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV0, CONST D3DXVECTOR2 *pV1,
				CONST D3DXVECTOR2 *pV2, CONST D3DXVECTOR2 *pV3, FLOAT s ) = NULL;

			// Barycentric coordinates.  V1 + f(V2-V1) + g(V3-V1)
			D3DXVECTOR2* (WINAPI *D3DXVec2BaryCentric)
				( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2,
				CONST D3DXVECTOR2 *pV3, FLOAT f, FLOAT g) = NULL;

			// Transform (x, y, 0, 1) by matrix.
			D3DXVECTOR4* (WINAPI *D3DXVec2Transform)
				( D3DXVECTOR4 *pOut, CONST D3DXVECTOR2 *pV, CONST D3DXMATRIX *pM ) = NULL;

			// Transform (x, y, 0, 1) by matrix, project result back into w=1.
			D3DXVECTOR2* (WINAPI *D3DXVec2TransformCoord)
				( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV, CONST D3DXMATRIX *pM ) = NULL;

			// Transform (x, y, 0, 0) by matrix.
			D3DXVECTOR2* (WINAPI *D3DXVec2TransformNormal)
				( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV, CONST D3DXMATRIX *pM ) = NULL;

			// Transform Array (x, y, 0, 1) by matrix.
			D3DXVECTOR4* (WINAPI *D3DXVec2TransformArray)
				( D3DXVECTOR4 *pOut, UINT OutStride, CONST D3DXVECTOR2 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n) = NULL;

			// Transform Array (x, y, 0, 1) by matrix, project result back into w=1.
			D3DXVECTOR2* (WINAPI *D3DXVec2TransformCoordArray)
				( D3DXVECTOR2 *pOut, UINT OutStride, CONST D3DXVECTOR2 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n ) = NULL;

			// Transform Array (x, y, 0, 0) by matrix.
			D3DXVECTOR2* (WINAPI *D3DXVec2TransformNormalArray)
				( D3DXVECTOR2 *pOut, UINT OutStride, CONST D3DXVECTOR2 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n ) = NULL;


			D3DXVECTOR3* (WINAPI *D3DXVec3Normalize)
				( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV ) = NULL;

			// Hermite interpolation between position V1, tangent T1 (when s == 0)
			// and position V2, tangent T2 (when s == 1).
			D3DXVECTOR3* (WINAPI *D3DXVec3Hermite)
				( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pT1,
				CONST D3DXVECTOR3 *pV2, CONST D3DXVECTOR3 *pT2, FLOAT s ) = NULL;

			// CatmullRom interpolation between V1 (when s == 0) and V2 (when s == 1)
			D3DXVECTOR3* (WINAPI *D3DXVec3CatmullRom)
				( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV0, CONST D3DXVECTOR3 *pV1,
				CONST D3DXVECTOR3 *pV2, CONST D3DXVECTOR3 *pV3, FLOAT s ) = NULL;

			// Barycentric coordinates.  V1 + f(V2-V1) + g(V3-V1)
			D3DXVECTOR3* (WINAPI *D3DXVec3BaryCentric)
				( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2,
				CONST D3DXVECTOR3 *pV3, FLOAT f, FLOAT g) = NULL;

			// Transform (x, y, z, 1) by matrix.
			D3DXVECTOR4* (WINAPI *D3DXVec3Transform)
				( D3DXVECTOR4 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DXMATRIX *pM ) = NULL;

			// Transform (x, y, z, 1) by matrix, project result back into w=1.
			D3DXVECTOR3* (WINAPI *D3DXVec3TransformCoord)
				( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DXMATRIX *pM ) = NULL;

			// Transform (x, y, z, 0) by matrix.  If you transforming a normal by a 
			// non-affine matrix, the matrix you pass to this function should be the 
			// transpose of the inverse of the matrix you would use to transform a coord.
			D3DXVECTOR3* (WINAPI *D3DXVec3TransformNormal)
				( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DXMATRIX *pM ) = NULL;


			// Transform Array (x, y, z, 1) by matrix. 
			D3DXVECTOR4* (WINAPI *D3DXVec3TransformArray)
				( D3DXVECTOR4 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n ) = NULL;

			// Transform Array (x, y, z, 1) by matrix, project result back into w=1.
			D3DXVECTOR3* (WINAPI *D3DXVec3TransformCoordArray)
				( D3DXVECTOR3 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n ) = NULL;

			// Transform (x, y, z, 0) by matrix.  If you transforming a normal by a 
			// non-affine matrix, the matrix you pass to this function should be the 
			// transpose of the inverse of the matrix you would use to transform a coord.
			D3DXVECTOR3* (WINAPI *D3DXVec3TransformNormalArray)
				( D3DXVECTOR3 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n ) = NULL;

			// Project vector from object space into screen space
			D3DXVECTOR3* (WINAPI *D3DXVec3Project)
				( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DVIEWPORT9 *pViewport,
				CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld) = NULL;

			// Project vector from screen space into object space
			D3DXVECTOR3* (WINAPI *D3DXVec3Unproject)
				( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DVIEWPORT9 *pViewport,
				CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld) = NULL;

			// Project vector Array from object space into screen space
			D3DXVECTOR3* (WINAPI *D3DXVec3ProjectArray)
				( D3DXVECTOR3 *pOut, UINT OutStride,CONST D3DXVECTOR3 *pV, UINT VStride,CONST D3DVIEWPORT9 *pViewport,
				CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld, UINT n) = NULL;

			// Project vector Array from screen space into object space
			D3DXVECTOR3* (WINAPI *D3DXVec3UnprojectArray)
				( D3DXVECTOR3 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3DVIEWPORT9 *pViewport,
				CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld, UINT n) = NULL;



			// Cross-product in 4 dimensions.
			D3DXVECTOR4* (WINAPI *D3DXVec4Cross)
				( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2,
				CONST D3DXVECTOR4 *pV3) = NULL;

			D3DXVECTOR4* (WINAPI *D3DXVec4Normalize)
				( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV ) = NULL;

			// Hermite interpolation between position V1, tangent T1 (when s == 0)
			// and position V2, tangent T2 (when s == 1).
			D3DXVECTOR4* (WINAPI *D3DXVec4Hermite)
				( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pT1,
				CONST D3DXVECTOR4 *pV2, CONST D3DXVECTOR4 *pT2, FLOAT s ) = NULL;

			// CatmullRom interpolation between V1 (when s == 0) and V2 (when s == 1)
			D3DXVECTOR4* (WINAPI *D3DXVec4CatmullRom)
				( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV0, CONST D3DXVECTOR4 *pV1,
				CONST D3DXVECTOR4 *pV2, CONST D3DXVECTOR4 *pV3, FLOAT s ) = NULL;

			// Barycentric coordinates.  V1 + f(V2-V1) + g(V3-V1)
			D3DXVECTOR4* (WINAPI *D3DXVec4BaryCentric)
				( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2,
				CONST D3DXVECTOR4 *pV3, FLOAT f, FLOAT g) = NULL;

			// Transform vector by matrix.
			D3DXVECTOR4* (WINAPI *D3DXVec4Transform)
				( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV, CONST D3DXMATRIX *pM ) = NULL;

			// Transform vector array by matrix.
			D3DXVECTOR4* (WINAPI *D3DXVec4TransformArray)
				( D3DXVECTOR4 *pOut, UINT OutStride, CONST D3DXVECTOR4 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n ) = NULL;


			FLOAT (WINAPI *D3DXMatrixDeterminant)
				( CONST D3DXMATRIX *pM ) = NULL;

			HRESULT (WINAPI *D3DXMatrixDecompose)
				( D3DXVECTOR3 *pOutScale, D3DXQUATERNION *pOutRotation, 
				D3DXVECTOR3 *pOutTranslation, CONST D3DXMATRIX *pM ) = NULL;

			D3DXMATRIX* (WINAPI *D3DXMatrixTranspose)
				( D3DXMATRIX *pOut, CONST D3DXMATRIX *pM ) = NULL;

			// Matrix multiplication.  The result represents the transformation M2
			// followed by the transformation M1.  (Out = M1 * M2)
			D3DXMATRIX* (WINAPI *D3DXMatrixMultiply)
				( D3DXMATRIX *pOut, CONST D3DXMATRIX *pM1, CONST D3DXMATRIX *pM2 ) = NULL;

			// Matrix multiplication, followed by a transpose. (Out = T(M1 * M2))
			D3DXMATRIX* (WINAPI *D3DXMatrixMultiplyTranspose)
				( D3DXMATRIX *pOut, CONST D3DXMATRIX *pM1, CONST D3DXMATRIX *pM2 ) = NULL;

			// Calculate inverse of matrix.  Inversion my fail, in which case NULL will
			// be returned.  The determinant of pM is also returned it pfDeterminant
			// is non-NULL.
			D3DXMATRIX* (WINAPI *D3DXMatrixInverse)
				( D3DXMATRIX *pOut, FLOAT *pDeterminant, CONST D3DXMATRIX *pM ) = NULL;

			// Build a matrix which scales by (sx, sy, sz)
			D3DXMATRIX* (WINAPI *D3DXMatrixScaling)
				( D3DXMATRIX *pOut, FLOAT sx, FLOAT sy, FLOAT sz ) = NULL;

			// Build a matrix which translates by (x, y, z)
			D3DXMATRIX* (WINAPI *D3DXMatrixTranslation)
				( D3DXMATRIX *pOut, FLOAT x, FLOAT y, FLOAT z ) = NULL;

			// Build a matrix which rotates around the X axis
			D3DXMATRIX* (WINAPI *D3DXMatrixRotationX)
				( D3DXMATRIX *pOut, FLOAT Angle ) = NULL;

			// Build a matrix which rotates around the Y axis
			D3DXMATRIX* (WINAPI *D3DXMatrixRotationY)
				( D3DXMATRIX *pOut, FLOAT Angle ) = NULL;

			// Build a matrix which rotates around the Z axis
			D3DXMATRIX* (WINAPI *D3DXMatrixRotationZ)
				( D3DXMATRIX *pOut, FLOAT Angle ) = NULL;

			// Build a matrix which rotates around an arbitrary axis
			D3DXMATRIX* (WINAPI *D3DXMatrixRotationAxis)
				( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pV, FLOAT Angle ) = NULL;

			// Build a matrix from a quaternion
			D3DXMATRIX* (WINAPI *D3DXMatrixRotationQuaternion)
				( D3DXMATRIX *pOut, CONST D3DXQUATERNION *pQ) = NULL;

			// Yaw around the Y axis, a pitch around the X axis,
			// and a roll around the Z axis.
			D3DXMATRIX* (WINAPI *D3DXMatrixRotationYawPitchRoll)
				( D3DXMATRIX *pOut, FLOAT Yaw, FLOAT Pitch, FLOAT Roll ) = NULL;

			// Build transformation matrix.  NULL arguments are treated as identity.
			// Mout = Msc-1 * Msr-1 * Ms * Msr * Msc * Mrc-1 * Mr * Mrc * Mt
			D3DXMATRIX* (WINAPI *D3DXMatrixTransformation)
				( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pScalingCenter,
				CONST D3DXQUATERNION *pScalingRotation, CONST D3DXVECTOR3 *pScaling,
				CONST D3DXVECTOR3 *pRotationCenter, CONST D3DXQUATERNION *pRotation,
				CONST D3DXVECTOR3 *pTranslation) = NULL;

			// Build 2D transformation matrix in XY plane.  NULL arguments are treated as identity.
			// Mout = Msc-1 * Msr-1 * Ms * Msr * Msc * Mrc-1 * Mr * Mrc * Mt
			D3DXMATRIX* (WINAPI *D3DXMatrixTransformation2D)
				( D3DXMATRIX *pOut, CONST D3DXVECTOR2* pScalingCenter, 
				FLOAT ScalingRotation, CONST D3DXVECTOR2* pScaling, 
				CONST D3DXVECTOR2* pRotationCenter, FLOAT Rotation, 
				CONST D3DXVECTOR2* pTranslation) = NULL;

			// Build affine transformation matrix.  NULL arguments are treated as identity.
			// Mout = Ms * Mrc-1 * Mr * Mrc * Mt
			D3DXMATRIX* (WINAPI *D3DXMatrixAffineTransformation)
				( D3DXMATRIX *pOut, FLOAT Scaling, CONST D3DXVECTOR3 *pRotationCenter,
				CONST D3DXQUATERNION *pRotation, CONST D3DXVECTOR3 *pTranslation) = NULL;

			// Build 2D affine transformation matrix in XY plane.  NULL arguments are treated as identity.
			// Mout = Ms * Mrc-1 * Mr * Mrc * Mt
			D3DXMATRIX* (WINAPI *D3DXMatrixAffineTransformation2D)
				( D3DXMATRIX *pOut, FLOAT Scaling, CONST D3DXVECTOR2* pRotationCenter, 
				FLOAT Rotation, CONST D3DXVECTOR2* pTranslation) = NULL;

			// Build a lookat matrix. (right-handed)
			D3DXMATRIX* (WINAPI *D3DXMatrixLookAtRH)
				( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pEye, CONST D3DXVECTOR3 *pAt,
				CONST D3DXVECTOR3 *pUp ) = NULL;

			// Build a lookat matrix. (left-handed)
			D3DXMATRIX* (WINAPI *D3DXMatrixLookAtLH)
				( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pEye, CONST D3DXVECTOR3 *pAt,
				CONST D3DXVECTOR3 *pUp ) = NULL;

			// Build a perspective projection matrix. (right-handed)
			D3DXMATRIX* (WINAPI *D3DXMatrixPerspectiveRH)
				( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf ) = NULL;

			// Build a perspective projection matrix. (left-handed)
			D3DXMATRIX* (WINAPI *D3DXMatrixPerspectiveLH)
				( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf ) = NULL;

			// Build a perspective projection matrix. (right-handed)
			D3DXMATRIX* (WINAPI *D3DXMatrixPerspectiveFovRH)
				( D3DXMATRIX *pOut, FLOAT fovy, FLOAT Aspect, FLOAT zn, FLOAT zf ) = NULL;

			// Build a perspective projection matrix. (left-handed)
			D3DXMATRIX* (WINAPI *D3DXMatrixPerspectiveFovLH)
				( D3DXMATRIX *pOut, FLOAT fovy, FLOAT Aspect, FLOAT zn, FLOAT zf ) = NULL;

			// Build a perspective projection matrix. (right-handed)
			D3DXMATRIX* (WINAPI *D3DXMatrixPerspectiveOffCenterRH)
				( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn,
				FLOAT zf ) = NULL;

			// Build a perspective projection matrix. (left-handed)
			D3DXMATRIX* (WINAPI *D3DXMatrixPerspectiveOffCenterLH)
				( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn,
				FLOAT zf ) = NULL;

			// Build an ortho projection matrix. (right-handed)
			D3DXMATRIX* (WINAPI *D3DXMatrixOrthoRH)
				( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf ) = NULL;

			// Build an ortho projection matrix. (left-handed)
			D3DXMATRIX* (WINAPI *D3DXMatrixOrthoLH)
				( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf ) = NULL;

			// Build an ortho projection matrix. (right-handed)
			D3DXMATRIX* (WINAPI *D3DXMatrixOrthoOffCenterRH)
				( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn,
				FLOAT zf ) = NULL;

			// Build an ortho projection matrix. (left-handed)
			D3DXMATRIX* (WINAPI *D3DXMatrixOrthoOffCenterLH)
				( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn,
				FLOAT zf ) = NULL;

			// Build a matrix which flattens geometry into a plane, as if casting
			// a shadow from a light.
			D3DXMATRIX* (WINAPI *D3DXMatrixShadow)
				( D3DXMATRIX *pOut, CONST D3DXVECTOR4 *pLight,
				CONST D3DXPLANE *pPlane ) = NULL;

			// Build a matrix which reflects the coordinate system about a plane
			D3DXMATRIX* (WINAPI *D3DXMatrixReflect)
				( D3DXMATRIX *pOut, CONST D3DXPLANE *pPlane ) = NULL;


			// Compute a quaternin's axis and angle of rotation. Expects unit quaternions.
			void (WINAPI *D3DXQuaternionToAxisAngle)
				( CONST D3DXQUATERNION *pQ, D3DXVECTOR3 *pAxis, FLOAT *pAngle ) = NULL;

			// Build a quaternion from a rotation matrix.
			D3DXQUATERNION* (WINAPI *D3DXQuaternionRotationMatrix)
				( D3DXQUATERNION *pOut, CONST D3DXMATRIX *pM) = NULL;

			// Rotation about arbitrary axis.
			D3DXQUATERNION* (WINAPI *D3DXQuaternionRotationAxis)
				( D3DXQUATERNION *pOut, CONST D3DXVECTOR3 *pV, FLOAT Angle ) = NULL;

			// Yaw around the Y axis, a pitch around the X axis,
			// and a roll around the Z axis.
			D3DXQUATERNION* (WINAPI *D3DXQuaternionRotationYawPitchRoll)
				( D3DXQUATERNION *pOut, FLOAT Yaw, FLOAT Pitch, FLOAT Roll ) = NULL;

			// Quaternion multiplication.  The result represents the rotation Q2
			// followed by the rotation Q1.  (Out = Q2 * Q1)
			D3DXQUATERNION* (WINAPI *D3DXQuaternionMultiply)
				( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1,
				CONST D3DXQUATERNION *pQ2 ) = NULL;

			D3DXQUATERNION* (WINAPI *D3DXQuaternionNormalize)
				( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ ) = NULL;

			// Conjugate and re-norm
			D3DXQUATERNION* (WINAPI *D3DXQuaternionInverse)
				( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ ) = NULL;

			// Expects unit quaternions.
			// if q = (cos(theta), sin(theta) * v) = NULL; ln(q) = (0, theta * v)
			D3DXQUATERNION* (WINAPI *D3DXQuaternionLn)
				( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ ) = NULL;

			// Expects pure quaternions. (w == 0)  w is ignored in calculation.
			// if q = (0, theta * v) = NULL; exp(q) = (cos(theta), sin(theta) * v)
			D3DXQUATERNION* (WINAPI *D3DXQuaternionExp)
				( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ ) = NULL;

			// Spherical linear interpolation between Q1 (t == 0) and Q2 (t == 1).
			// Expects unit quaternions.
			D3DXQUATERNION* (WINAPI *D3DXQuaternionSlerp)
				( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1,
				CONST D3DXQUATERNION *pQ2, FLOAT t ) = NULL;

			// Spherical quadrangle interpolation.
			// Slerp(Slerp(Q1, C, t), Slerp(A, B, t), 2t(1-t))
			D3DXQUATERNION* (WINAPI *D3DXQuaternionSquad)
				( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1,
				CONST D3DXQUATERNION *pA, CONST D3DXQUATERNION *pB,
				CONST D3DXQUATERNION *pC, FLOAT t ) = NULL;

			// Setup control points for spherical quadrangle interpolation
			// from Q1 to Q2.  The control points are chosen in such a way 
			// to ensure the continuity of tangents with adjacent segments.
			void (WINAPI *D3DXQuaternionSquadSetup)
				( D3DXQUATERNION *pAOut, D3DXQUATERNION *pBOut, D3DXQUATERNION *pCOut,
				CONST D3DXQUATERNION *pQ0, CONST D3DXQUATERNION *pQ1, 
				CONST D3DXQUATERNION *pQ2, CONST D3DXQUATERNION *pQ3 ) = NULL;

			// Barycentric interpolation.
			// Slerp(Slerp(Q1, Q2, f+g), Slerp(Q1, Q3, f+g), g/(f+g))
			D3DXQUATERNION* (WINAPI *D3DXQuaternionBaryCentric)
				( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1,
				CONST D3DXQUATERNION *pQ2, CONST D3DXQUATERNION *pQ3,
				FLOAT f, FLOAT g ) = NULL;



			// Normalize plane (so that |a,b,c| == 1)
			D3DXPLANE* (WINAPI *D3DXPlaneNormalize)
				( D3DXPLANE *pOut, CONST D3DXPLANE *pP) = NULL;

			// Find the intersection between a plane and a line.  If the line is
			// parallel to the plane, NULL is returned.
			D3DXVECTOR3* (WINAPI *D3DXPlaneIntersectLine)
				( D3DXVECTOR3 *pOut, CONST D3DXPLANE *pP, CONST D3DXVECTOR3 *pV1,
				CONST D3DXVECTOR3 *pV2) = NULL;

			// Construct a plane from a point and a normal
			D3DXPLANE* (WINAPI *D3DXPlaneFromPointNormal)
				( D3DXPLANE *pOut, CONST D3DXVECTOR3 *pPoint, CONST D3DXVECTOR3 *pNormal) = NULL;

			// Construct a plane from 3 points
			D3DXPLANE* (WINAPI *D3DXPlaneFromPoints)
				( D3DXPLANE *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2,
				CONST D3DXVECTOR3 *pV3) = NULL;

			// Transform a plane by a matrix.  The vector (a,b,c) must be normal.
			// M should be the inverse transpose of the transformation desired.
			D3DXPLANE* (WINAPI *D3DXPlaneTransform)
				( D3DXPLANE *pOut, CONST D3DXPLANE *pP, CONST D3DXMATRIX *pM ) = NULL;

			// Transform an array of planes by a matrix.  The vectors (a,b,c) must be normal.
			// M should be the inverse transpose of the transformation desired.
			D3DXPLANE* (WINAPI *D3DXPlaneTransformArray)
				( D3DXPLANE *pOut, UINT OutStride, CONST D3DXPLANE *pP, UINT PStride, CONST D3DXMATRIX *pM, UINT n ) = NULL;




			// Interpolate r,g,b between desaturated color and color.
			// DesaturatedColor + s(Color - DesaturatedColor)
			D3DXCOLOR* (WINAPI *D3DXColorAdjustSaturation)
				(D3DXCOLOR *pOut, CONST D3DXCOLOR *pC, FLOAT s) = NULL;

			// Interpolate r,g,b between 50% grey and color.  Grey + s(Color - Grey)
			D3DXCOLOR* (WINAPI *D3DXColorAdjustContrast)
				(D3DXCOLOR *pOut, CONST D3DXCOLOR *pC, FLOAT c) = NULL;



			// Calculate Fresnel term given the cosine of theta (likely obtained by
			// taking the dot of two normals), and the refraction index of the material.
			FLOAT (WINAPI *D3DXFresnelTerm)
				(FLOAT CosTheta, FLOAT RefractionIndex) = NULL;


			HRESULT (WINAPI *D3DXCreateMatrixStack)( 
				DWORD               Flags, 
				LPD3DXMATRIXSTACK*  ppStack) = NULL;


			FLOAT* (WINAPI *D3DXSHEvalDirection)
				(  FLOAT *pOut, UINT Order, CONST D3DXVECTOR3 *pDir ) = NULL;

			FLOAT* (WINAPI *D3DXSHRotate)
				( FLOAT *pOut, UINT Order, CONST D3DXMATRIX *pMatrix, CONST FLOAT *pIn ) = NULL;


			FLOAT* (WINAPI *D3DXSHRotateZ)
				( FLOAT *pOut, UINT Order, FLOAT Angle, CONST FLOAT *pIn ) = NULL;

			FLOAT* (WINAPI *D3DXSHAdd)
				( FLOAT *pOut, UINT Order, CONST FLOAT *pA, CONST FLOAT *pB ) = NULL;

			FLOAT* (WINAPI *D3DXSHScale)
				( FLOAT *pOut, UINT Order, CONST FLOAT *pIn, CONST FLOAT Scale ) = NULL;

			FLOAT (WINAPI *D3DXSHDot)
				( UINT Order, CONST FLOAT *pA, CONST FLOAT *pB ) = NULL;

			FLOAT* (WINAPI *D3DXSHMultiply2)( FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG) = NULL;
			FLOAT* (WINAPI *D3DXSHMultiply3)( FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG) = NULL;
			FLOAT* (WINAPI *D3DXSHMultiply4)( FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG) = NULL;
			FLOAT* (WINAPI *D3DXSHMultiply5)( FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG) = NULL;
			FLOAT* (WINAPI *D3DXSHMultiply6)( FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG) = NULL;

			HRESULT (WINAPI *D3DXSHEvalDirectionalLight)
				( UINT Order, CONST D3DXVECTOR3 *pDir, 
				FLOAT RIntensity, FLOAT GIntensity, FLOAT BIntensity,
				FLOAT *pROut, FLOAT *pGOut, FLOAT *pBOut ) = NULL;

			HRESULT (WINAPI *D3DXSHEvalSphericalLight)
				( UINT Order, CONST D3DXVECTOR3 *pPos, FLOAT Radius,
				FLOAT RIntensity, FLOAT GIntensity, FLOAT BIntensity,
				FLOAT *pROut, FLOAT *pGOut, FLOAT *pBOut ) = NULL;

			HRESULT (WINAPI *D3DXSHEvalConeLight)
				( UINT Order, CONST D3DXVECTOR3 *pDir, FLOAT Radius,
				FLOAT RIntensity, FLOAT GIntensity, FLOAT BIntensity,
				FLOAT *pROut, FLOAT *pGOut, FLOAT *pBOut ) = NULL;

			HRESULT (WINAPI *D3DXSHEvalHemisphereLight)
				( UINT Order, CONST D3DXVECTOR3 *pDir, D3DXCOLOR Top, D3DXCOLOR Bottom,
				FLOAT *pROut, FLOAT *pGOut, FLOAT *pBOut ) = NULL;

			HRESULT (WINAPI *D3DXSHProjectCubeMap)
				( UINT uOrder, LPDIRECT3DCUBETEXTURE9 pCubeMap,
				FLOAT *pROut, FLOAT *pGOut, FLOAT *pBOut ) = NULL;


			HRESULT (WINAPI *D3DXCreateSprite)( 
				LPDIRECT3DDEVICE9   pDevice, 
				LPD3DXSPRITE*       ppSprite) = NULL;


			HRESULT (WINAPI *D3DXCreateFont)(
				LPDIRECT3DDEVICE9       pDevice,  
				INT                     Height,
				UINT                    Width,
				UINT                    Weight,
				UINT                    MipLevels,
				BOOL                    Italic,
				DWORD                   CharSet,
				DWORD                   OutputPrecision,
				DWORD                   Quality,
				DWORD                   PitchAndFamily,
				LPCWSTR                 pFaceName,
				LPD3DXFONT*             ppFont) = NULL;

			HRESULT (WINAPI *D3DXCreateFontIndirect)( 
				LPDIRECT3DDEVICE9       pDevice, 
				CONST D3DXFONT_DESC*   pDesc, 
				LPD3DXFONT*             ppFont) = NULL;

			HRESULT (WINAPI *D3DXCreateRenderToSurface)(
				LPDIRECT3DDEVICE9       pDevice,
				UINT                    Width,
				UINT                    Height,
				D3DFORMAT               Format,
				BOOL                    DepthStencil,
				D3DFORMAT               DepthStencilFormat,
				LPD3DXRENDERTOSURFACE*  ppRenderToSurface) = NULL;

			HRESULT (WINAPI *D3DXCreateRenderToEnvMap)(
				LPDIRECT3DDEVICE9       pDevice,
				UINT                    Size,
				UINT                    MipLevels,
				D3DFORMAT               Format,
				BOOL                    DepthStencil,
				D3DFORMAT               DepthStencilFormat,
				LPD3DXRenderToEnvMap*   ppRenderToEnvMap) = NULL;

			HRESULT (WINAPI *D3DXCreateLine)(
				LPDIRECT3DDEVICE9   pDevice,
				LPD3DXLINE*         ppLine) = NULL;

			HRESULT (WINAPI *D3DXAssembleShaderFromFile)(
				LPCWSTR                         pSrcFile,
				CONST D3DXMACRO*                pDefines,
				LPD3DXINCLUDE                   pInclude,
				DWORD                           Flags,
				LPD3DXBUFFER*                   ppShader,
				LPD3DXBUFFER*                   ppErrorMsgs) = NULL;

			HRESULT (WINAPI *D3DXAssembleShader)(
				LPCSTR                          pSrcData,
				UINT                            SrcDataLen,
				CONST D3DXMACRO*                pDefines,
				LPD3DXINCLUDE                   pInclude,
				DWORD                           Flags,
				LPD3DXBUFFER*                   ppShader,
				LPD3DXBUFFER*                   ppErrorMsgs) = NULL;

			HRESULT (WINAPI *D3DXCompileShaderFromFile)(
				LPCWSTR                         pSrcFile,
				CONST D3DXMACRO*                pDefines,
				LPD3DXINCLUDE                   pInclude,
				LPCSTR                          pFunctionName,
				LPCSTR                          pProfile,
				DWORD                           Flags,
				LPD3DXBUFFER*                   ppShader,
				LPD3DXBUFFER*                   ppErrorMsgs,
				LPD3DXCONSTANTTABLE*            ppConstantTable);

			HRESULT (WINAPI *D3DXCompileShader)(
				LPCSTR                          pSrcData,
				UINT                            SrcDataLen,
				CONST D3DXMACRO*                pDefines,
				LPD3DXINCLUDE                   pInclude,
				LPCSTR                          pFunctionName,
				LPCSTR                          pProfile,
				DWORD                           Flags,
				LPD3DXBUFFER*                   ppShader,
				LPD3DXBUFFER*                   ppErrorMsgs,
				LPD3DXCONSTANTTABLE*            ppConstantTable) = NULL;

			HRESULT (WINAPI *D3DXDisassembleShader)(
				CONST DWORD*                    pShader, 
				BOOL                            EnableColorCode, 
				LPCSTR                          pComments, 
				LPD3DXBUFFER*                   ppDisassembly) = NULL;

			LPCSTR (WINAPI *D3DXGetPixelShaderProfile)(
				LPDIRECT3DDEVICE9               pDevice) = NULL;

			LPCSTR (WINAPI *D3DXGetVertexShaderProfile)(
				LPDIRECT3DDEVICE9               pDevice) = NULL;

			HRESULT (WINAPI *D3DXFindShaderComment)(
				CONST DWORD*                    pFunction,
				DWORD                           FourCC,
				LPCVOID*                        ppData,
				UINT*                           pSizeInBytes) = NULL;

			UINT (WINAPI *D3DXGetShaderSize)(
				CONST DWORD*                    pFunction) = NULL;

			DWORD (WINAPI *D3DXGetShaderVersion)(
				CONST DWORD*                    pFunction) = NULL;

			HRESULT (WINAPI *D3DXGetShaderInputSemantics)(
				CONST DWORD*                    pFunction,
				D3DXSEMANTIC*                   pSemantics,
				UINT*                           pCount) = NULL;

			HRESULT (WINAPI *D3DXGetShaderOutputSemantics)(
				CONST DWORD*                    pFunction,
				D3DXSEMANTIC*                   pSemantics,
				UINT*                           pCount) = NULL;

			HRESULT (WINAPI *D3DXGetShaderSamplers)(
				CONST DWORD*                    pFunction,
				LPCSTR*                         pSamplers,
				UINT*                           pCount) = NULL;

			HRESULT (WINAPI *D3DXGetShaderConstantTable)(
				CONST DWORD*                    pFunction,
				LPD3DXCONSTANTTABLE*            ppConstantTable) = NULL;

			HRESULT (WINAPI *D3DXGetShaderConstantTableEx)(
				CONST DWORD*                    pFunction,
				DWORD                           Flags,
				LPD3DXCONSTANTTABLE*            ppConstantTable) = NULL;

			HRESULT (WINAPI *D3DXCreateTextureShader)(
				CONST DWORD*                    pFunction, 
				LPD3DXTEXTURESHADER*            ppTextureShader) = NULL;

			HRESULT (WINAPI *D3DXGatherFragmentsFromFile)(
				LPCWSTR                         pSrcFile,
				CONST D3DXMACRO*                pDefines,
				LPD3DXINCLUDE                   pInclude,
				DWORD                           Flags,
				LPD3DXBUFFER*                   ppShader,
				LPD3DXBUFFER*                   ppErrorMsgs) = NULL;

			HRESULT (WINAPI *D3DXGatherFragments)(
				LPCSTR                          pSrcData,
				UINT                            SrcDataLen,
				CONST D3DXMACRO*                pDefines,
				LPD3DXINCLUDE                   pInclude,
				DWORD                           Flags,
				LPD3DXBUFFER*                   ppShader,
				LPD3DXBUFFER*                   ppErrorMsgs) = NULL;

			HRESULT (WINAPI *D3DXCreateFragmentLinker)(
				LPDIRECT3DDEVICE9               pDevice,
				UINT                            ShaderCacheSize,
				LPD3DXFRAGMENTLINKER*           ppFragmentLinker) = NULL;

			HRESULT (WINAPI *D3DXCreateFragmentLinkerEx)(
				LPDIRECT3DDEVICE9               pDevice,
				UINT                            ShaderCacheSize,
				DWORD                           Flags,
				LPD3DXFRAGMENTLINKER*           ppFragmentLinker) = NULL;

			HRESULT (WINAPI *D3DXPreprocessShaderFromFile)(
				LPCWSTR                      pSrcFile,
				CONST D3DXMACRO*             pDefines,
				LPD3DXINCLUDE                pInclude,
				LPD3DXBUFFER*                ppShaderText,
				LPD3DXBUFFER*                ppErrorMsgs) = NULL;

			HRESULT (WINAPI *D3DXPreprocessShader)(
				LPCSTR                       pSrcData,
				UINT                         SrcDataSize,
				CONST D3DXMACRO*             pDefines,
				LPD3DXINCLUDE                pInclude,
				LPD3DXBUFFER*                ppShaderText,
				LPD3DXBUFFER*                ppErrorMsgs) = NULL;


			HRESULT (WINAPI *D3DXCreateEffectPool)(
				LPD3DXEFFECTPOOL*               ppPool) = NULL;

			HRESULT (WINAPI *D3DXCreateEffectFromFile)(
				LPDIRECT3DDEVICE9               pDevice,
				LPCWSTR                         pSrcFile,
				CONST D3DXMACRO*                pDefines,
				LPD3DXINCLUDE                   pInclude,
				DWORD                           Flags,
				LPD3DXEFFECTPOOL                pPool,
				LPD3DXEFFECT*                   ppEffect,
				LPD3DXBUFFER*                   ppCompilationErrors) = NULL;

			HRESULT (WINAPI *D3DXCreateEffect)(
				LPDIRECT3DDEVICE9               pDevice,
				LPCVOID                         pSrcData,
				UINT                            SrcDataLen,
				CONST D3DXMACRO*                pDefines,
				LPD3DXINCLUDE                   pInclude,
				DWORD                           Flags,
				LPD3DXEFFECTPOOL                pPool,
				LPD3DXEFFECT*                   ppEffect,
				LPD3DXBUFFER*                   ppCompilationErrors) = NULL;

			HRESULT (WINAPI *D3DXCreateEffectFromFileEx)(
				LPDIRECT3DDEVICE9               pDevice,
				LPCWSTR                         pSrcFile,
				CONST D3DXMACRO*                pDefines,
				LPD3DXINCLUDE                   pInclude,
				LPCSTR                          pSkipConstants, 
				DWORD                           Flags,
				LPD3DXEFFECTPOOL                pPool,
				LPD3DXEFFECT*                   ppEffect,
				LPD3DXBUFFER*                   ppCompilationErrors) = NULL;

			HRESULT (WINAPI *D3DXCreateEffectEx)(
				LPDIRECT3DDEVICE9               pDevice,
				LPCVOID                         pSrcData,
				UINT                            SrcDataLen,
				CONST D3DXMACRO*                pDefines,
				LPD3DXINCLUDE                   pInclude,
				LPCSTR                          pSkipConstants, 
				DWORD                           Flags,
				LPD3DXEFFECTPOOL                pPool,
				LPD3DXEFFECT*                   ppEffect,
				LPD3DXBUFFER*                   ppCompilationErrors) = NULL;

			HRESULT (WINAPI *D3DXCreateEffectCompilerFromFile)(
				LPCWSTR                         pSrcFile,
				CONST D3DXMACRO*                pDefines,
				LPD3DXINCLUDE                   pInclude,
				DWORD                           Flags,
				LPD3DXEFFECTCOMPILER*           ppCompiler,
				LPD3DXBUFFER*                   ppParseErrors);

			HRESULT (WINAPI *D3DXCreateEffectCompiler)(
				LPCSTR                          pSrcData,
				UINT                            SrcDataLen,
				CONST D3DXMACRO*                pDefines,
				LPD3DXINCLUDE                   pInclude,
				DWORD                           Flags,
				LPD3DXEFFECTCOMPILER*           ppCompiler,
				LPD3DXBUFFER*                   ppParseErrors) = NULL;

			HRESULT (WINAPI *D3DXDisassembleEffect)(
				LPD3DXEFFECT pEffect, 
				BOOL EnableColorCode, 
				LPD3DXBUFFER *ppDisassembly) = NULL;

			HRESULT (WINAPI *D3DXGetImageInfoFromFile)(
				LPCWSTR                   pSrcFile,
				D3DXIMAGE_INFO*           pSrcInfo) = NULL;

			HRESULT (WINAPI *D3DXGetImageInfoFromFileInMemory)(
				LPCVOID                   pSrcData,
				UINT                      SrcDataSize,
				D3DXIMAGE_INFO*           pSrcInfo) = NULL;

			HRESULT (WINAPI *D3DXLoadSurfaceFromFile)(
				LPDIRECT3DSURFACE9        pDestSurface,
				CONST PALETTEENTRY*       pDestPalette,
				CONST RECT*               pDestRect,
				LPCWSTR                   pSrcFile,
				CONST RECT*               pSrcRect,
				DWORD                     Filter,
				D3DCOLOR                  ColorKey,
				D3DXIMAGE_INFO*           pSrcInfo) = NULL;

			HRESULT (WINAPI *D3DXLoadSurfaceFromFileInMemory)(
				LPDIRECT3DSURFACE9        pDestSurface,
				CONST PALETTEENTRY*       pDestPalette,
				CONST RECT*               pDestRect,
				LPCVOID                   pSrcData,
				UINT                      SrcDataSize,
				CONST RECT*               pSrcRect,
				DWORD                     Filter,
				D3DCOLOR                  ColorKey,
				D3DXIMAGE_INFO*           pSrcInfo) = NULL;

			HRESULT (WINAPI *D3DXLoadSurfaceFromSurface)(
				LPDIRECT3DSURFACE9        pDestSurface,
				CONST PALETTEENTRY*       pDestPalette,
				CONST RECT*               pDestRect,
				LPDIRECT3DSURFACE9        pSrcSurface,
				CONST PALETTEENTRY*       pSrcPalette,
				CONST RECT*               pSrcRect,
				DWORD                     Filter,
				D3DCOLOR                  ColorKey) = NULL;

			HRESULT (WINAPI *D3DXLoadSurfaceFromMemory)(
				LPDIRECT3DSURFACE9        pDestSurface,
				CONST PALETTEENTRY*       pDestPalette,
				CONST RECT*               pDestRect,
				LPCVOID                   pSrcMemory,
				D3DFORMAT                 SrcFormat,
				UINT                      SrcPitch,
				CONST PALETTEENTRY*       pSrcPalette,
				CONST RECT*               pSrcRect,
				DWORD                     Filter,
				D3DCOLOR                  ColorKey) = NULL;

			HRESULT (WINAPI *D3DXSaveSurfaceToFile)(
				LPCWSTR                   pDestFile,
				D3DXIMAGE_FILEFORMAT      DestFormat,
				LPDIRECT3DSURFACE9        pSrcSurface,
				CONST PALETTEENTRY*       pSrcPalette,
				CONST RECT*               pSrcRect) = NULL;

			HRESULT (WINAPI *D3DXSaveSurfaceToFileInMemory)(
				LPD3DXBUFFER*             ppDestBuf,
				D3DXIMAGE_FILEFORMAT      DestFormat,
				LPDIRECT3DSURFACE9        pSrcSurface,
				CONST PALETTEENTRY*       pSrcPalette,
				CONST RECT*               pSrcRect) = NULL;

			HRESULT (WINAPI *D3DXLoadVolumeFromFile)(
				LPDIRECT3DVOLUME9         pDestVolume,
				CONST PALETTEENTRY*       pDestPalette,
				CONST D3DBOX*             pDestBox,
				LPCWSTR                   pSrcFile,
				CONST D3DBOX*             pSrcBox,
				DWORD                     Filter,
				D3DCOLOR                  ColorKey,
				D3DXIMAGE_INFO*           pSrcInfo) = NULL;

			HRESULT (WINAPI *D3DXLoadVolumeFromFileInMemory)(
				LPDIRECT3DVOLUME9         pDestVolume,
				CONST PALETTEENTRY*       pDestPalette,
				CONST D3DBOX*             pDestBox,
				LPCVOID                   pSrcData,
				UINT                      SrcDataSize,
				CONST D3DBOX*             pSrcBox,
				DWORD                     Filter,
				D3DCOLOR                  ColorKey,
				D3DXIMAGE_INFO*           pSrcInfo) = NULL;

			HRESULT (WINAPI *D3DXLoadVolumeFromVolume)(
				LPDIRECT3DVOLUME9         pDestVolume,
				CONST PALETTEENTRY*       pDestPalette,
				CONST D3DBOX*             pDestBox,
				LPDIRECT3DVOLUME9         pSrcVolume,
				CONST PALETTEENTRY*       pSrcPalette,
				CONST D3DBOX*             pSrcBox,
				DWORD                     Filter,
				D3DCOLOR                  ColorKey) = NULL;

			HRESULT (WINAPI *D3DXSaveVolumeToFile)(
				LPCWSTR                   pDestFile,
				D3DXIMAGE_FILEFORMAT      DestFormat,
				LPDIRECT3DVOLUME9         pSrcVolume,
				CONST PALETTEENTRY*       pSrcPalette,
				CONST D3DBOX*             pSrcBox) = NULL;

			HRESULT (WINAPI *D3DXSaveVolumeToFileInMemory)(
				LPD3DXBUFFER*             ppDestBuf,
				D3DXIMAGE_FILEFORMAT      DestFormat,
				LPDIRECT3DVOLUME9         pSrcVolume,
				CONST PALETTEENTRY*       pSrcPalette,
				CONST D3DBOX*             pSrcBox) = NULL;

			HRESULT (WINAPI *D3DXCheckTextureRequirements)(
				LPDIRECT3DDEVICE9         pDevice,
				UINT*                     pWidth,
				UINT*                     pHeight,
				UINT*                     pNumMipLevels,
				DWORD                     Usage,
				D3DFORMAT*                pFormat,
				D3DPOOL                   Pool) = NULL;

			HRESULT (WINAPI *D3DXCheckCubeTextureRequirements)(
				LPDIRECT3DDEVICE9         pDevice,
				UINT*                     pSize,
				UINT*                     pNumMipLevels,
				DWORD                     Usage,
				D3DFORMAT*                pFormat,
				D3DPOOL                   Pool) = NULL;

			HRESULT (WINAPI *D3DXCheckVolumeTextureRequirements)(
				LPDIRECT3DDEVICE9         pDevice,
				UINT*                     pWidth,
				UINT*                     pHeight,
				UINT*                     pDepth,
				UINT*                     pNumMipLevels,
				DWORD                     Usage,
				D3DFORMAT*                pFormat,
				D3DPOOL                   Pool) = NULL;

			HRESULT (WINAPI *D3DXCreateTexture)(
				LPDIRECT3DDEVICE9         pDevice,
				UINT                      Width,
				UINT                      Height,
				UINT                      MipLevels,
				DWORD                     Usage,
				D3DFORMAT                 Format,
				D3DPOOL                   Pool,
				LPDIRECT3DTEXTURE9*       ppTexture) = NULL;

			HRESULT (WINAPI *D3DXCreateCubeTexture)(
				LPDIRECT3DDEVICE9         pDevice,
				UINT                      Size,
				UINT                      MipLevels,
				DWORD                     Usage,
				D3DFORMAT                 Format,
				D3DPOOL                   Pool,
				LPDIRECT3DCUBETEXTURE9*   ppCubeTexture) = NULL;

			HRESULT (WINAPI *D3DXCreateVolumeTexture)(
				LPDIRECT3DDEVICE9         pDevice,
				UINT                      Width,
				UINT                      Height,
				UINT                      Depth,
				UINT                      MipLevels,
				DWORD                     Usage,
				D3DFORMAT                 Format,
				D3DPOOL                   Pool,
				LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture) = NULL;

			HRESULT (WINAPI *D3DXCreateTextureFromFile)(
				LPDIRECT3DDEVICE9         pDevice,
				LPCWSTR                   pSrcFile,
				LPDIRECT3DTEXTURE9*       ppTexture) = NULL;

			HRESULT (WINAPI *D3DXCreateTextureFromFileInMemory)(
				LPDIRECT3DDEVICE9         pDevice,
				LPCVOID                   pSrcData,
				UINT                      SrcDataSize,
				LPDIRECT3DTEXTURE9*       ppTexture) = NULL;

			HRESULT (WINAPI *D3DXCreateCubeTextureFromFile)(
				LPDIRECT3DDEVICE9         pDevice,
				LPCWSTR                   pSrcFile,
				LPDIRECT3DCUBETEXTURE9*   ppCubeTexture) = NULL;

			HRESULT (WINAPI *D3DXCreateCubeTextureFromFileInMemory)(
				LPDIRECT3DDEVICE9         pDevice,
				LPCVOID                   pSrcData,
				UINT                      SrcDataSize,
				LPDIRECT3DCUBETEXTURE9*   ppCubeTexture) = NULL;

			HRESULT (WINAPI *D3DXCreateVolumeTextureFromFile)(
				LPDIRECT3DDEVICE9         pDevice,
				LPCWSTR                   pSrcFile,
				LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture);

			HRESULT (WINAPI *D3DXCreateVolumeTextureFromFileInMemory)(
				LPDIRECT3DDEVICE9         pDevice,
				LPCVOID                   pSrcData,
				UINT                      SrcDataSize,
				LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture) = NULL;


			// FromFileInMemoryEx

			HRESULT (WINAPI *D3DXCreateTextureFromFileEx)(
				LPDIRECT3DDEVICE9         pDevice,
				LPCWSTR                   pSrcFile,
				UINT                      Width,
				UINT                      Height,
				UINT                      MipLevels,
				DWORD                     Usage,
				D3DFORMAT                 Format,
				D3DPOOL                   Pool,
				DWORD                     Filter,
				DWORD                     MipFilter,
				D3DCOLOR                  ColorKey,
				D3DXIMAGE_INFO*           pSrcInfo,
				PALETTEENTRY*             pPalette,
				LPDIRECT3DTEXTURE9*       ppTexture) = NULL;

			HRESULT (WINAPI *D3DXCreateTextureFromFileInMemoryEx)(
				LPDIRECT3DDEVICE9         pDevice,
				LPCVOID                   pSrcData,
				UINT                      SrcDataSize,
				UINT                      Width,
				UINT                      Height,
				UINT                      MipLevels,
				DWORD                     Usage,
				D3DFORMAT                 Format,
				D3DPOOL                   Pool,
				DWORD                     Filter,
				DWORD                     MipFilter,
				D3DCOLOR                  ColorKey,
				D3DXIMAGE_INFO*           pSrcInfo,
				PALETTEENTRY*             pPalette,
				LPDIRECT3DTEXTURE9*       ppTexture) = NULL;

			HRESULT (WINAPI *D3DXCreateCubeTextureFromFileEx)(
				LPDIRECT3DDEVICE9 pDevice,
				LPCTSTR pSrcFile,
				UINT Width,
				UINT Height,
				UINT MipLevels,
				DWORD Usage,
				D3DFORMAT Format,
				D3DPOOL Pool,
				DWORD Filter,
				DWORD MipFilter,
				D3DCOLOR ColorKey,
				D3DXIMAGE_INFO * pSrcInfo,
				PALETTEENTRY * pPalette,
				LPDIRECT3DTEXTURE9 * ppTexture ) = NULL;

			HRESULT (WINAPI *D3DXCreateCubeTextureFromFileInMemoryEx)(
				LPDIRECT3DDEVICE9         pDevice,
				LPCVOID                   pSrcData,
				UINT                      SrcDataSize,
				UINT                      Size,
				UINT                      MipLevels,
				DWORD                     Usage,
				D3DFORMAT                 Format,
				D3DPOOL                   Pool,
				DWORD                     Filter,
				DWORD                     MipFilter,
				D3DCOLOR                  ColorKey,
				D3DXIMAGE_INFO*           pSrcInfo,
				PALETTEENTRY*             pPalette,
				LPDIRECT3DCUBETEXTURE9*   ppCubeTexture) = NULL;

			HRESULT (WINAPI *D3DXCreateVolumeTextureFromFileEx)(
			LPDIRECT3DDEVICE9         pDevice,
			LPCWSTR                   pSrcFile,
			UINT                      Width,
			UINT                      Height,
			UINT                      Depth,
			UINT                      MipLevels,
			DWORD                     Usage,
			D3DFORMAT                 Format,
			D3DPOOL                   Pool,
			DWORD                     Filter,
			DWORD                     MipFilter,
			D3DCOLOR                  ColorKey,
			D3DXIMAGE_INFO*           pSrcInfo,
			PALETTEENTRY*             pPalette,
			LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture) = NULL;

			HRESULT (WINAPI *D3DXCreateVolumeTextureFromFileInMemoryEx)(
				LPDIRECT3DDEVICE9         pDevice,
				LPCVOID                   pSrcData,
				UINT                      SrcDataSize,
				UINT                      Width,
				UINT                      Height,
				UINT                      Depth,
				UINT                      MipLevels,
				DWORD                     Usage,
				D3DFORMAT                 Format,
				D3DPOOL                   Pool,
				DWORD                     Filter,
				DWORD                     MipFilter,
				D3DCOLOR                  ColorKey,
				D3DXIMAGE_INFO*           pSrcInfo,
				PALETTEENTRY*             pPalette,
				LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture) = NULL;

			HRESULT (WINAPI *D3DXSaveTextureToFile)(
				LPCWSTR                   pDestFile,
				D3DXIMAGE_FILEFORMAT      DestFormat,
				LPDIRECT3DBASETEXTURE9    pSrcTexture,
				CONST PALETTEENTRY*       pSrcPalette) = NULL;

			HRESULT (WINAPI *D3DXSaveTextureToFileInMemory)(
				LPD3DXBUFFER*             ppDestBuf,
				D3DXIMAGE_FILEFORMAT      DestFormat,
				LPDIRECT3DBASETEXTURE9    pSrcTexture,
				CONST PALETTEENTRY*       pSrcPalette) = NULL;

			HRESULT (WINAPI *D3DXFilterTexture)(
				LPDIRECT3DBASETEXTURE9    pBaseTexture,
				CONST PALETTEENTRY*       pPalette,
				UINT                      SrcLevel,
				DWORD                     Filter) = NULL;

			HRESULT (WINAPI *D3DXFillTexture)(
				LPDIRECT3DTEXTURE9        pTexture,
				LPD3DXFILL2D              pFunction,
				LPVOID                    pData) = NULL;

			HRESULT (WINAPI *D3DXFillCubeTexture)(
				LPDIRECT3DCUBETEXTURE9    pCubeTexture,
				LPD3DXFILL3D              pFunction,
				LPVOID                    pData) = NULL;

			HRESULT (WINAPI *D3DXFillVolumeTexture)(
				LPDIRECT3DVOLUMETEXTURE9  pVolumeTexture,
				LPD3DXFILL3D              pFunction,
				LPVOID                    pData) = NULL;

			HRESULT (WINAPI *D3DXFillTextureTX)(
				LPDIRECT3DTEXTURE9        pTexture,
				LPD3DXTEXTURESHADER       pTextureShader) = NULL;


			HRESULT (WINAPI *D3DXFillCubeTextureTX)(
				LPDIRECT3DCUBETEXTURE9    pCubeTexture,
				LPD3DXTEXTURESHADER       pTextureShader) = NULL;


			HRESULT (WINAPI *D3DXFillVolumeTextureTX)(
				LPDIRECT3DVOLUMETEXTURE9  pVolumeTexture,
				LPD3DXTEXTURESHADER       pTextureShader) = NULL;

			HRESULT (WINAPI *D3DXComputeNormalMap)(
				LPDIRECT3DTEXTURE9        pTexture,
				LPDIRECT3DTEXTURE9        pSrcTexture,
				CONST PALETTEENTRY*       pSrcPalette,
				DWORD                     Flags,
				DWORD                     Channel,
				FLOAT                     Amplitude) = NULL;

			//@}
		}

		// InitializeDirect3D9
		void InitializeDirect3D9( bool enableDebug , bool enablePerf )
		{
#if _DYNAMIC_LOAD_DX9
			if( fn::s_hDirect3D9Module )
			{
				TRACE_WARNING( _S("Direct3D9 has been initialized.") );
				return;
			}

			// Load module
			if( enableDebug )
			{
				fn::s_hDirect3D9Module = ::LoadLibrary( _S("d3d9d.dll") );
				if( fn::s_hDirect3D9Module == NULL )
				{
					TRACE_ERROR( _S("No debug version of Direct3D9 exists, use retail verison.") );
					fn::s_hDirect3D9Module = ::LoadLibrary( _S("d3d9.dll") );
				}
			}
			else
			{
				fn::s_hDirect3D9Module = ::LoadLibrary( _S("d3d9.dll") );
			}
			if( fn::s_hDirect3D9Module == NULL )
			{
				FATAL_ABORT( _S("Cannot load Direct3D9.") );
			}
#endif

#if _DYNAMIC_LOAD_DX9
#define LOAD_FN( NAME )			*(void**)&(fn::NAME) = ::GetProcAddress( fn::s_hDirect3D9Module , #NAME ); XS_ASSERT(fn::NAME)
#else
#define LOAD_FN( NAME )			*(void**)&(fn::NAME) = &::NAME
#endif
			LOAD_FN( Direct3DCreate9 );
			if( enablePerf )
			{
				LOAD_FN( D3DPERF_BeginEvent );
				LOAD_FN( D3DPERF_EndEvent );
				LOAD_FN( D3DPERF_SetMarker );
				LOAD_FN( D3DPERF_SetRegion );
				LOAD_FN( D3DPERF_QueryRepeatFrame );
				LOAD_FN( D3DPERF_SetOptions );
				LOAD_FN( D3DPERF_GetStatus );
			}

#undef LOAD_FN
		}

#define	MINIMUM_SUPPORT			(27)

		// InitializeDirect3DX9
		void InitializeDirect3DX9( bool enableDebug , uint version )
		{
#if _DYNAMIC_LOAD_DX9
			if( fn::s_hDirect3DX9Module )
			{
				TRACE_WARNING( _S("Direct3DX9 has been initialized.") );
				return;
			}

			for( uint ver = version ; ver >= MINIMUM_SUPPORT ; --ver )
			{
				wchar_t buf[64];
				swprintf( buf , enableDebug ? L"d3dx9d_%u.dll" : L"d3dx9_%u.dll" , ver );

				// Load module
				fn::s_hDirect3DX9Module = ::LoadLibrary( buf );

				if( fn::s_hDirect3DX9Module )
					break;
				TRACE_WARNING( _S("InitializeDirect3DX9: Failed to load library <%s>, try to load older version." ) , buf );
			}
			if( fn::s_hDirect3DX9Module == NULL )
			{
				if( enableDebug )
				{
					TRACE_WARNING( _S("InitializeDirect3DX9: Cannot load d3dx9 debug version, try non-debug version." ) );

					// Try to load again.
					InitializeDirect3DX9( false , version );
				}
				if( fn::s_hDirect3DX9Module == NULL )
				{
					FATAL_ABORT( _S("Cannot load Direct3DX9.") );
				}
			}
#endif

#if _DYNAMIC_LOAD_DX9
#define LOAD_FN( NAME )			*(void**)&(fn::NAME) = ::GetProcAddress( fn::s_hDirect3DX9Module , #NAME ); XS_ASSERT(fn::NAME)
#define LOAD_FNW( NAME )			*(void**)&(fn::NAME) = ::GetProcAddress( fn::s_hDirect3DX9Module , #NAME "W" ); XS_ASSERT(fn::NAME)
#else
#define LOAD_FN( NAME )			*(void**)&(fn::NAME) = &::NAME
#endif

			LOAD_FN( D3DXFloat32To16Array );
			LOAD_FN( D3DXFloat16To32Array );
			LOAD_FN( D3DXVec2Normalize );
			LOAD_FN( D3DXVec2Hermite );
			LOAD_FN( D3DXVec2CatmullRom );
			LOAD_FN( D3DXVec2BaryCentric );
			LOAD_FN( D3DXVec2Transform );
			LOAD_FN( D3DXVec2TransformCoord );
			LOAD_FN( D3DXVec2TransformNormal );
			LOAD_FN( D3DXVec2TransformArray );
			LOAD_FN( D3DXVec2TransformCoordArray );
			LOAD_FN( D3DXVec2TransformNormalArray );
			LOAD_FN( D3DXVec3Normalize );
			LOAD_FN( D3DXVec3Hermite );
			LOAD_FN( D3DXVec3CatmullRom );
			LOAD_FN( D3DXVec3BaryCentric );
			LOAD_FN( D3DXVec3Transform );
			LOAD_FN( D3DXVec3TransformCoord );
			LOAD_FN( D3DXVec3TransformNormal );
			LOAD_FN( D3DXVec3TransformArray );
			LOAD_FN( D3DXVec3TransformCoordArray );
			LOAD_FN( D3DXVec3TransformNormalArray );
			LOAD_FN( D3DXVec3Project );
			LOAD_FN( D3DXVec3Unproject );
			LOAD_FN( D3DXVec3ProjectArray );
			LOAD_FN( D3DXVec3UnprojectArray );
			LOAD_FN( D3DXVec4Cross );
			LOAD_FN( D3DXVec4Normalize );
			LOAD_FN( D3DXVec4Hermite );
			LOAD_FN( D3DXVec4CatmullRom );
			LOAD_FN( D3DXVec4BaryCentric );
			LOAD_FN( D3DXVec4Transform );
			LOAD_FN( D3DXVec4TransformArray );
			LOAD_FN( D3DXMatrixDeterminant );
			LOAD_FN( D3DXMatrixDecompose );
			LOAD_FN( D3DXMatrixTranspose );
			LOAD_FN( D3DXMatrixMultiply );
			LOAD_FN( D3DXMatrixMultiplyTranspose );
			LOAD_FN( D3DXMatrixInverse );
			LOAD_FN( D3DXMatrixScaling );
			LOAD_FN( D3DXMatrixTranslation );
			LOAD_FN( D3DXMatrixRotationX );
			LOAD_FN( D3DXMatrixRotationY );
			LOAD_FN( D3DXMatrixRotationZ );
			LOAD_FN( D3DXMatrixRotationAxis );
			LOAD_FN( D3DXMatrixRotationQuaternion );
			LOAD_FN( D3DXMatrixRotationYawPitchRoll );
			LOAD_FN( D3DXMatrixTransformation );
			LOAD_FN( D3DXMatrixTransformation2D );
			LOAD_FN( D3DXMatrixAffineTransformation );
			LOAD_FN( D3DXMatrixAffineTransformation2D );
			LOAD_FN( D3DXMatrixLookAtRH );
			LOAD_FN( D3DXMatrixLookAtLH );
			LOAD_FN( D3DXMatrixPerspectiveRH );
			LOAD_FN( D3DXMatrixPerspectiveLH );
			LOAD_FN( D3DXMatrixPerspectiveFovRH );
			LOAD_FN( D3DXMatrixPerspectiveFovLH );
			LOAD_FN( D3DXMatrixPerspectiveOffCenterRH );
			LOAD_FN( D3DXMatrixPerspectiveOffCenterLH );
			LOAD_FN( D3DXMatrixOrthoRH );
			LOAD_FN( D3DXMatrixOrthoLH );
			LOAD_FN( D3DXMatrixOrthoOffCenterRH );
			LOAD_FN( D3DXMatrixOrthoOffCenterLH );
			LOAD_FN( D3DXMatrixShadow );
			LOAD_FN( D3DXMatrixReflect );
			LOAD_FN( D3DXQuaternionToAxisAngle );
			LOAD_FN( D3DXQuaternionRotationMatrix );
			LOAD_FN( D3DXQuaternionRotationAxis );
			LOAD_FN( D3DXQuaternionRotationYawPitchRoll );
			LOAD_FN( D3DXQuaternionMultiply );
			LOAD_FN( D3DXQuaternionNormalize );
			LOAD_FN( D3DXQuaternionInverse );
			LOAD_FN( D3DXQuaternionLn );
			LOAD_FN( D3DXQuaternionExp );
			LOAD_FN( D3DXQuaternionSlerp );
			LOAD_FN( D3DXQuaternionSquad );
			LOAD_FN( D3DXQuaternionSquadSetup );
			LOAD_FN( D3DXQuaternionBaryCentric );
			LOAD_FN( D3DXPlaneNormalize );
			LOAD_FN( D3DXPlaneIntersectLine );
			LOAD_FN( D3DXPlaneFromPointNormal );
			LOAD_FN( D3DXPlaneFromPoints );
			LOAD_FN( D3DXPlaneTransform );
			LOAD_FN( D3DXPlaneTransformArray );
			LOAD_FN( D3DXColorAdjustSaturation );
			LOAD_FN( D3DXColorAdjustContrast );
			LOAD_FN( D3DXFresnelTerm );
			LOAD_FN( D3DXCreateMatrixStack );
			LOAD_FN( D3DXSHEvalDirection );
			LOAD_FN( D3DXSHRotate );
			LOAD_FN( D3DXSHRotateZ );
			LOAD_FN( D3DXSHAdd );
			LOAD_FN( D3DXSHScale );
			LOAD_FN( D3DXSHDot );
			LOAD_FN( D3DXSHMultiply2 );
			LOAD_FN( D3DXSHMultiply3 );
			LOAD_FN( D3DXSHMultiply4 );
			LOAD_FN( D3DXSHMultiply5 );
			LOAD_FN( D3DXSHMultiply6 );
			LOAD_FN( D3DXSHEvalDirectionalLight );
			LOAD_FN( D3DXSHEvalSphericalLight );
			LOAD_FN( D3DXSHEvalConeLight );
			LOAD_FN( D3DXSHEvalHemisphereLight );
			LOAD_FN( D3DXSHProjectCubeMap );
			LOAD_FN( D3DXCreateSprite );
			LOAD_FNW( D3DXCreateFont );
			LOAD_FNW( D3DXCreateFontIndirect );
			LOAD_FN( D3DXCreateRenderToSurface );
			LOAD_FN( D3DXCreateRenderToEnvMap );
			LOAD_FN( D3DXCreateLine );
			LOAD_FNW( D3DXAssembleShaderFromFile );
			LOAD_FN( D3DXAssembleShader );
			LOAD_FNW( D3DXCompileShaderFromFile );
			LOAD_FN( D3DXCompileShader );
			LOAD_FN( D3DXDisassembleShader );
			LOAD_FN( D3DXGetPixelShaderProfile );
			LOAD_FN( D3DXGetVertexShaderProfile );
			LOAD_FN( D3DXFindShaderComment );
			LOAD_FN( D3DXGetShaderSize );
			LOAD_FN( D3DXGetShaderVersion );
			LOAD_FN( D3DXGetShaderInputSemantics );
			LOAD_FN( D3DXGetShaderOutputSemantics );
			LOAD_FN( D3DXGetShaderSamplers );
			LOAD_FN( D3DXGetShaderConstantTable );
			LOAD_FN( D3DXGetShaderConstantTableEx );
			LOAD_FN( D3DXCreateTextureShader );
			LOAD_FNW( D3DXGatherFragmentsFromFile );
			LOAD_FN( D3DXGatherFragments );
			LOAD_FN( D3DXCreateFragmentLinker );
			LOAD_FN( D3DXCreateFragmentLinkerEx );
			LOAD_FNW( D3DXPreprocessShaderFromFile );
			LOAD_FN( D3DXPreprocessShader );
			LOAD_FN( D3DXCreateEffectPool );
			LOAD_FNW( D3DXCreateEffectFromFile );
			LOAD_FN( D3DXCreateEffect );
			LOAD_FNW( D3DXCreateEffectFromFileEx );
			LOAD_FN( D3DXCreateEffectEx );
			LOAD_FNW( D3DXCreateEffectCompilerFromFile );
			LOAD_FN( D3DXCreateEffectCompiler );
			LOAD_FN( D3DXDisassembleEffect );
			LOAD_FNW( D3DXGetImageInfoFromFile );
			LOAD_FN( D3DXGetImageInfoFromFileInMemory );
			LOAD_FNW( D3DXLoadSurfaceFromFile );
			LOAD_FN( D3DXLoadSurfaceFromFileInMemory );
			LOAD_FN( D3DXLoadSurfaceFromSurface );
			LOAD_FN( D3DXLoadSurfaceFromMemory );
			LOAD_FNW( D3DXSaveSurfaceToFile );
			LOAD_FN( D3DXSaveSurfaceToFileInMemory );
			LOAD_FNW( D3DXLoadVolumeFromFile );
			LOAD_FN( D3DXLoadVolumeFromFileInMemory );
			LOAD_FN( D3DXLoadVolumeFromVolume );
			LOAD_FNW( D3DXSaveVolumeToFile );
			LOAD_FN( D3DXSaveVolumeToFileInMemory );
			LOAD_FN( D3DXCheckTextureRequirements );
			LOAD_FN( D3DXCheckCubeTextureRequirements );
			LOAD_FN( D3DXCheckVolumeTextureRequirements );
			LOAD_FN( D3DXCreateTexture );
			LOAD_FN( D3DXCreateCubeTexture );
			LOAD_FN( D3DXCreateVolumeTexture );
			LOAD_FNW( D3DXCreateTextureFromFile );
			LOAD_FN( D3DXCreateTextureFromFileInMemory );
			LOAD_FNW( D3DXCreateCubeTextureFromFile );
			LOAD_FN( D3DXCreateCubeTextureFromFileInMemory );
			LOAD_FNW( D3DXCreateVolumeTextureFromFile );
			LOAD_FN( D3DXCreateVolumeTextureFromFileInMemory );
			LOAD_FNW( D3DXCreateTextureFromFileEx );
			LOAD_FN( D3DXCreateTextureFromFileInMemoryEx );
			LOAD_FNW( D3DXCreateCubeTextureFromFileEx );
			LOAD_FN( D3DXCreateCubeTextureFromFileInMemoryEx );
			LOAD_FNW( D3DXCreateVolumeTextureFromFileEx );
			LOAD_FN( D3DXCreateVolumeTextureFromFileInMemoryEx );
			LOAD_FNW( D3DXSaveTextureToFile );
			LOAD_FN( D3DXSaveTextureToFileInMemory );
			LOAD_FN( D3DXFilterTexture );
			LOAD_FN( D3DXFillTexture );
			LOAD_FN( D3DXFillCubeTexture );
			LOAD_FN( D3DXFillVolumeTexture );
			LOAD_FN( D3DXFillTextureTX );
			LOAD_FN( D3DXFillCubeTextureTX );
			LOAD_FN( D3DXFillVolumeTextureTX );
			LOAD_FN( D3DXComputeNormalMap );

#undef LOAD_FN
#undef LOAD_FNW
		}

		// Direct3DCreate9
		IDirect3D9 * WINAPI Direct3DCreate9( UINT SDKVersion )
		{
			return fn::Direct3DCreate9( SDKVersion );
		}

		// D3DPERF_BeginEvent
		int WINAPI D3DPERF_BeginEvent( D3DCOLOR col, LPCWSTR wszName )
		{
			return fn::D3DPERF_BeginEvent( col , wszName );
		}

		// D3DPERF_EndEvent
		int WINAPI D3DPERF_EndEvent( void )
		{
			return fn::D3DPERF_EndEvent();
		}

		// D3DPERF_SetMarker
		void WINAPI D3DPERF_SetMarker( D3DCOLOR col, LPCWSTR wszName )
		{
			fn::D3DPERF_SetMarker( col , wszName );
		}

		// D3DPERF_SetRegion
		void WINAPI D3DPERF_SetRegion( D3DCOLOR col, LPCWSTR wszName )
		{
			fn::D3DPERF_SetRegion( col , wszName );
		}

		// D3DPERF_QueryRepeatFrame
		BOOL WINAPI D3DPERF_QueryRepeatFrame( void )
		{
			return fn::D3DPERF_QueryRepeatFrame();
		}

		// D3DPERF_SetOptions
		void WINAPI D3DPERF_SetOptions( DWORD dwOptions )
		{
			fn::D3DPERF_SetOptions( dwOptions );
		}

		// D3DPERF_GetStatus
		DWORD WINAPI D3DPERF_GetStatus( void )
		{
			return fn::D3DPERF_GetStatus();
		}

		// D3DXFloat32To16Array
		D3DXFLOAT16* WINAPI D3DXFloat32To16Array( D3DXFLOAT16 *pOut, CONST FLOAT *pIn, UINT n )
		{
			return fn::D3DXFloat32To16Array( pOut , pIn , n );
		}

		// D3DXFloat16To32Array
		FLOAT* WINAPI D3DXFloat16To32Array( FLOAT *pOut, CONST D3DXFLOAT16 *pIn, UINT n )
		{
			return fn::D3DXFloat16To32Array( pOut , pIn , n );
		}

		// D3DXVec2Normalize
		D3DXVECTOR2* WINAPI D3DXVec2Normalize( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV )
		{
			return fn::D3DXVec2Normalize( pOut, pV );
		}

		// D3DXVec2Hermite
		D3DXVECTOR2* WINAPI D3DXVec2Hermite( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pT1, CONST D3DXVECTOR2 *pV2, CONST D3DXVECTOR2 *pT2, FLOAT s )
		{
			return fn::D3DXVec2Hermite( pOut, pV1, pT1, pV2, pT2, s );
		}

		// D3DXVec2CatmullRom
		D3DXVECTOR2* WINAPI D3DXVec2CatmullRom( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV0, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2, CONST D3DXVECTOR2 *pV3, FLOAT s )
		{
			return fn::D3DXVec2CatmullRom( pOut, pV0, pV1, pV2, pV3, s );
		}

		// D3DXVec2BaryCentric
		D3DXVECTOR2* WINAPI D3DXVec2BaryCentric( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV1, CONST D3DXVECTOR2 *pV2, CONST D3DXVECTOR2 *pV3, FLOAT f, FLOAT g )
		{
			return fn::D3DXVec2BaryCentric( pOut, pV1, pV2, pV3, f, g );
		}

		// D3DXVec2Transform
		D3DXVECTOR4* WINAPI D3DXVec2Transform( D3DXVECTOR4 *pOut, CONST D3DXVECTOR2 *pV, CONST D3DXMATRIX *pM )
		{
			return fn::D3DXVec2Transform( pOut, pV, pM );
		}

		// D3DXVec2TransformCoord
		D3DXVECTOR2* WINAPI D3DXVec2TransformCoord( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV, CONST D3DXMATRIX *pM )
		{
			return fn::D3DXVec2TransformCoord( pOut, pV, pM );
		}

		// D3DXVec2TransformNormal
		D3DXVECTOR2* WINAPI D3DXVec2TransformNormal( D3DXVECTOR2 *pOut, CONST D3DXVECTOR2 *pV, CONST D3DXMATRIX *pM )
		{
			return fn::D3DXVec2TransformNormal( pOut, pV, pM );
		}

		// D3DXVec2TransformArray
		D3DXVECTOR4* WINAPI D3DXVec2TransformArray( D3DXVECTOR4 *pOut, UINT OutStride, CONST D3DXVECTOR2 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n )
		{
			return fn::D3DXVec2TransformArray( pOut, OutStride, pV, VStride, pM, n );
		}

		// D3DXVec2TransformCoordArray
		D3DXVECTOR2* WINAPI D3DXVec2TransformCoordArray( D3DXVECTOR2 *pOut, UINT OutStride, CONST D3DXVECTOR2 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n )
		{
			return fn::D3DXVec2TransformCoordArray( pOut, OutStride, pV, VStride, pM, n );
		}

		// D3DXVec2TransformNormalArray
		D3DXVECTOR2* WINAPI D3DXVec2TransformNormalArray( D3DXVECTOR2 *pOut, UINT OutStride, CONST D3DXVECTOR2 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n )
		{
			return fn::D3DXVec2TransformNormalArray( pOut, OutStride, pV, VStride, pM, n );
		}

		// D3DXVec3Normalize
		D3DXVECTOR3* WINAPI D3DXVec3Normalize( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV )
		{
			return fn::D3DXVec3Normalize( pOut, pV );
		}

		// D3DXVec3Hermite
		D3DXVECTOR3* WINAPI D3DXVec3Hermite( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pT1, CONST D3DXVECTOR3 *pV2, CONST D3DXVECTOR3 *pT2, FLOAT s )
		{
			return fn::D3DXVec3Hermite( pOut, pV1, pT1, pV2, pT2, s );
		}

		// D3DXVec3CatmullRom
		D3DXVECTOR3* WINAPI D3DXVec3CatmullRom( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV0, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2, CONST D3DXVECTOR3 *pV3, FLOAT s )
		{
			return fn::D3DXVec3CatmullRom( pOut, pV0, pV1, pV2, pV3, s );
		}

		// D3DXVec3BaryCentric
		D3DXVECTOR3* WINAPI D3DXVec3BaryCentric( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2, CONST D3DXVECTOR3 *pV3, FLOAT f, FLOAT g )
		{
			return fn::D3DXVec3BaryCentric( pOut, pV1, pV2, pV3, f, g );
		}

		// D3DXVec3Transform
		D3DXVECTOR4* WINAPI D3DXVec3Transform( D3DXVECTOR4 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DXMATRIX *pM )
		{
			return fn::D3DXVec3Transform( pOut, pV, pM );
		}

		// D3DXVec3TransformCoord
		D3DXVECTOR3* WINAPI D3DXVec3TransformCoord( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DXMATRIX *pM )
		{
			return fn::D3DXVec3TransformCoord( pOut, pV, pM );
		}

		// D3DXVec3TransformNormal
		D3DXVECTOR3* WINAPI D3DXVec3TransformNormal( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DXMATRIX *pM )
		{
			return fn::D3DXVec3TransformNormal( pOut, pV, pM );
		}

		// D3DXVec3TransformArray
		D3DXVECTOR4* WINAPI D3DXVec3TransformArray( D3DXVECTOR4 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n )
		{
			return fn::D3DXVec3TransformArray( pOut, OutStride, pV, VStride, pM, n );
		}

		// D3DXVec3TransformCoordArray
		D3DXVECTOR3* WINAPI D3DXVec3TransformCoordArray( D3DXVECTOR3 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n )
		{
			return fn::D3DXVec3TransformCoordArray( pOut, OutStride, pV, VStride, pM, n );
		}

		// D3DXVec3TransformNormalArray
		D3DXVECTOR3* WINAPI D3DXVec3TransformNormalArray( D3DXVECTOR3 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n )
		{
			return fn::D3DXVec3TransformNormalArray( pOut, OutStride, pV, VStride, pM, n );
		}

		// D3DXVec3Project
		D3DXVECTOR3* WINAPI D3DXVec3Project( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DVIEWPORT9 *pViewport, CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld )
		{
			return fn::D3DXVec3Project( pOut, pV, pViewport, pProjection, pView, pWorld );
		}

		// D3DXVec3Unproject
		D3DXVECTOR3* WINAPI D3DXVec3Unproject( D3DXVECTOR3 *pOut, CONST D3DXVECTOR3 *pV, CONST D3DVIEWPORT9 *pViewport, CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld )
		{
			return fn::D3DXVec3Unproject( pOut, pV, pViewport, pProjection, pView, pWorld );
		}

		// D3DXVec3ProjectArray
		D3DXVECTOR3* WINAPI D3DXVec3ProjectArray( D3DXVECTOR3 *pOut, UINT OutStride,CONST D3DXVECTOR3 *pV, UINT VStride,CONST D3DVIEWPORT9 *pViewport, CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld, UINT n )
		{
			return fn::D3DXVec3ProjectArray( pOut, OutStride, pV, VStride,pViewport, pProjection, pView, pWorld, n );
		}

		// D3DXVec3UnprojectArray
		D3DXVECTOR3* WINAPI D3DXVec3UnprojectArray( D3DXVECTOR3 *pOut, UINT OutStride, CONST D3DXVECTOR3 *pV, UINT VStride, CONST D3DVIEWPORT9 *pViewport, CONST D3DXMATRIX *pProjection, CONST D3DXMATRIX *pView, CONST D3DXMATRIX *pWorld, UINT n )
		{
			return fn::D3DXVec3UnprojectArray( pOut, OutStride, pV, VStride, pViewport, pProjection, pView, pWorld, n );
		}

		// D3DXVec4Cross
		D3DXVECTOR4* WINAPI D3DXVec4Cross( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2, CONST D3DXVECTOR4 *pV3 )
		{
			return fn::D3DXVec4Cross( pOut, pV1, pV2, pV3 );
		}

		// D3DXVec4Normalize
		D3DXVECTOR4* WINAPI D3DXVec4Normalize( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV )
		{
			return fn::D3DXVec4Normalize( pOut, pV );
		}

		// D3DXVec4Hermite
		D3DXVECTOR4* WINAPI D3DXVec4Hermite( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pT1, CONST D3DXVECTOR4 *pV2, CONST D3DXVECTOR4 *pT2, FLOAT s )
		{
			return fn::D3DXVec4Hermite( pOut, pV1, pT1, pV2, pT2, s );
		}

		// D3DXVec4CatmullRom
		D3DXVECTOR4* WINAPI D3DXVec4CatmullRom( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV0, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2, CONST D3DXVECTOR4 *pV3, FLOAT s )
		{
			return fn::D3DXVec4CatmullRom( pOut, pV0, pV1, pV2, pV3, s );
		}

		// D3DXVec4BaryCentric
		D3DXVECTOR4* WINAPI D3DXVec4BaryCentric( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV1, CONST D3DXVECTOR4 *pV2, CONST D3DXVECTOR4 *pV3, FLOAT f, FLOAT g )
		{
			return fn::D3DXVec4BaryCentric( pOut, pV1, pV2, pV3, f, g );
		}

		// D3DXVec4Transform
		D3DXVECTOR4* WINAPI D3DXVec4Transform( D3DXVECTOR4 *pOut, CONST D3DXVECTOR4 *pV, CONST D3DXMATRIX *pM )
		{
			return fn::D3DXVec4Transform( pOut, pV, pM );
		}

		// D3DXVec4TransformArray
		D3DXVECTOR4* WINAPI D3DXVec4TransformArray( D3DXVECTOR4 *pOut, UINT OutStride, CONST D3DXVECTOR4 *pV, UINT VStride, CONST D3DXMATRIX *pM, UINT n )
		{
			return fn::D3DXVec4TransformArray( pOut, OutStride, pV, VStride, pM, n );
		}

		// D3DXMatrixDeterminant
		FLOAT WINAPI D3DXMatrixDeterminant( CONST D3DXMATRIX *pM )
		{
			return fn::D3DXMatrixDeterminant( pM );
		}

		// D3DXMatrixDecompose
		HRESULT WINAPI D3DXMatrixDecompose( D3DXVECTOR3 *pOutScale, D3DXQUATERNION *pOutRotation, D3DXVECTOR3 *pOutTranslation, CONST D3DXMATRIX *pM )
		{
			return fn::D3DXMatrixDecompose( pOutScale, pOutRotation, pOutTranslation, pM );
		}

		// D3DXMatrixTranspose
		D3DXMATRIX* WINAPI D3DXMatrixTranspose( D3DXMATRIX *pOut, CONST D3DXMATRIX *pM )
		{
			return fn::D3DXMatrixTranspose( pOut, pM );
		}

		// D3DXMatrixMultiply
		D3DXMATRIX* WINAPI D3DXMatrixMultiply( D3DXMATRIX *pOut, CONST D3DXMATRIX *pM1, CONST D3DXMATRIX *pM2 )
		{
			return fn::D3DXMatrixMultiply( pOut, pM1, pM2 );
		}

		// D3DXMatrixMultiplyTranspose
		D3DXMATRIX* WINAPI D3DXMatrixMultiplyTranspose( D3DXMATRIX *pOut, CONST D3DXMATRIX *pM1, CONST D3DXMATRIX *pM2 )
		{
			return fn::D3DXMatrixMultiplyTranspose( pOut, pM1, pM2 );
		}

		// D3DXMatrixInverse
		D3DXMATRIX* WINAPI D3DXMatrixInverse( D3DXMATRIX *pOut, FLOAT *pDeterminant, CONST D3DXMATRIX *pM )
		{
			return fn::D3DXMatrixInverse( pOut, pDeterminant, pM );
		}

		// D3DXMatrixScaling
		D3DXMATRIX* WINAPI D3DXMatrixScaling( D3DXMATRIX *pOut, FLOAT sx, FLOAT sy, FLOAT sz )
		{
			return fn::D3DXMatrixScaling( pOut, sx, sy, sz );
		}

		// D3DXMatrixTranslation
		D3DXMATRIX* WINAPI D3DXMatrixTranslation( D3DXMATRIX *pOut, FLOAT x, FLOAT y, FLOAT z )
		{
			return fn::D3DXMatrixTranslation( pOut, x, y, z );
		}

		// D3DXMatrixRotationX
		D3DXMATRIX* WINAPI D3DXMatrixRotationX( D3DXMATRIX *pOut, FLOAT Angle )
		{
			return fn::D3DXMatrixRotationX( pOut, Angle );
		}

		// D3DXMatrixRotationY
		D3DXMATRIX* WINAPI D3DXMatrixRotationY( D3DXMATRIX *pOut, FLOAT Angle )
		{
			return fn::D3DXMatrixRotationY( pOut, Angle );
		}

		// D3DXMatrixRotationZ
		D3DXMATRIX* WINAPI D3DXMatrixRotationZ( D3DXMATRIX *pOut, FLOAT Angle )
		{
			return fn::D3DXMatrixRotationZ( pOut, Angle );
		}

		// D3DXMatrixRotationAxis
		D3DXMATRIX* WINAPI D3DXMatrixRotationAxis( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pV, FLOAT Angle )
		{
			return fn::D3DXMatrixRotationAxis( pOut, pV, Angle );
		}

		// D3DXMatrixRotationQuaternion
		D3DXMATRIX* WINAPI D3DXMatrixRotationQuaternion( D3DXMATRIX *pOut, CONST D3DXQUATERNION *pQ )
		{
			return fn::D3DXMatrixRotationQuaternion( pOut, pQ );
		}

		// D3DXMatrixRotationYawPitchRoll
		D3DXMATRIX* WINAPI D3DXMatrixRotationYawPitchRoll( D3DXMATRIX *pOut, FLOAT Yaw, FLOAT Pitch, FLOAT Roll )
		{
			return fn::D3DXMatrixRotationYawPitchRoll( pOut, Yaw, Pitch, Roll );
		}

		// D3DXMatrixTransformation
		D3DXMATRIX* WINAPI D3DXMatrixTransformation( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pScalingCenter, CONST D3DXQUATERNION *pScalingRotation, CONST D3DXVECTOR3 *pScaling, CONST D3DXVECTOR3 *pRotationCenter, CONST D3DXQUATERNION *pRotation, CONST D3DXVECTOR3 *pTranslation )
		{
			return fn::D3DXMatrixTransformation( pOut, pScalingCenter, pScalingRotation, pScaling, pRotationCenter, pRotation, pTranslation );
		}

		// D3DXMatrixTransformation2D
		D3DXMATRIX* WINAPI D3DXMatrixTransformation2D( D3DXMATRIX *pOut, CONST D3DXVECTOR2* pScalingCenter, FLOAT ScalingRotation, CONST D3DXVECTOR2* pScaling, CONST D3DXVECTOR2* pRotationCenter, FLOAT Rotation, CONST D3DXVECTOR2* pTranslation )
		{
			return fn::D3DXMatrixTransformation2D( pOut, pScalingCenter, ScalingRotation, pScaling, pRotationCenter, Rotation, pTranslation );
		}

		// D3DXMatrixAffineTransformation
		D3DXMATRIX* WINAPI D3DXMatrixAffineTransformation( D3DXMATRIX *pOut, FLOAT Scaling, CONST D3DXVECTOR3 *pRotationCenter, CONST D3DXQUATERNION *pRotation, CONST D3DXVECTOR3 *pTranslation )
		{
			return fn::D3DXMatrixAffineTransformation( pOut, Scaling, pRotationCenter, pRotation, pTranslation );
		}

		// D3DXMatrixAffineTransformation2D
		D3DXMATRIX* WINAPI D3DXMatrixAffineTransformation2D( D3DXMATRIX *pOut, FLOAT Scaling, CONST D3DXVECTOR2* pRotationCenter, FLOAT Rotation, CONST D3DXVECTOR2* pTranslation )
		{
			return fn::D3DXMatrixAffineTransformation2D( pOut, Scaling, pRotationCenter, Rotation, pTranslation );
		}

		// D3DXMatrixLookAtRH
		D3DXMATRIX* WINAPI D3DXMatrixLookAtRH( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pEye, CONST D3DXVECTOR3 *pAt, CONST D3DXVECTOR3 *pUp )
		{
			return fn::D3DXMatrixLookAtRH( pOut, pEye, pAt, pUp );
		}

		// D3DXMatrixLookAtLH
		D3DXMATRIX* WINAPI D3DXMatrixLookAtLH( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pEye, CONST D3DXVECTOR3 *pAt, CONST D3DXVECTOR3 *pUp )
		{
			return fn::D3DXMatrixLookAtLH( pOut, pEye, pAt, pUp );
		}

		// D3DXMatrixPerspectiveRH
		D3DXMATRIX* WINAPI D3DXMatrixPerspectiveRH( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf )
		{
			return fn::D3DXMatrixPerspectiveRH( pOut, w, h, zn, zf );
		}

		// D3DXMatrixPerspectiveLH
		D3DXMATRIX* WINAPI D3DXMatrixPerspectiveLH( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf )
		{
			return fn::D3DXMatrixPerspectiveLH( pOut, w, h, zn, zf );
		}

		// D3DXMatrixPerspectiveFovRH
		D3DXMATRIX* WINAPI D3DXMatrixPerspectiveFovRH( D3DXMATRIX *pOut, FLOAT fovy, FLOAT Aspect, FLOAT zn, FLOAT zf )
		{
			return fn::D3DXMatrixPerspectiveFovRH( pOut, fovy, Aspect, zn, zf );
		}

		// D3DXMatrixPerspectiveFovLH
		D3DXMATRIX* WINAPI D3DXMatrixPerspectiveFovLH( D3DXMATRIX *pOut, FLOAT fovy, FLOAT Aspect, FLOAT zn, FLOAT zf )
		{
			return fn::D3DXMatrixPerspectiveFovLH( pOut, fovy, Aspect, zn, zf );
		}

		// D3DXMatrixPerspectiveOffCenterRH
		D3DXMATRIX* WINAPI D3DXMatrixPerspectiveOffCenterRH( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf )
		{
			return fn::D3DXMatrixPerspectiveOffCenterRH( pOut, l, r, b, t, zn, zf );
		}

		// D3DXMatrixPerspectiveOffCenterLH
		D3DXMATRIX* WINAPI D3DXMatrixPerspectiveOffCenterLH( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf )
		{
			return fn::D3DXMatrixPerspectiveOffCenterLH( pOut, l, r, b, t, zn, zf );
		}

		// D3DXMatrixOrthoRH
		D3DXMATRIX* WINAPI D3DXMatrixOrthoRH( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf )
		{
			return fn::D3DXMatrixOrthoRH( pOut, w, h, zn, zf );
		}

		// D3DXMatrixOrthoLH
		D3DXMATRIX* WINAPI D3DXMatrixOrthoLH( D3DXMATRIX *pOut, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf )
		{
			return fn::D3DXMatrixOrthoLH( pOut, w, h, zn, zf );
		}

		// D3DXMatrixOrthoOffCenterRH
		D3DXMATRIX* WINAPI D3DXMatrixOrthoOffCenterRH( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf )
		{
			return fn::D3DXMatrixOrthoOffCenterRH( pOut, l, r, b, t, zn, zf );
		}

		// D3DXMatrixOrthoOffCenterLH
		D3DXMATRIX* WINAPI D3DXMatrixOrthoOffCenterLH( D3DXMATRIX *pOut, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf )
		{
			return fn::D3DXMatrixOrthoOffCenterLH( pOut, l, r, b, t, zn, zf );
		}

		// D3DXMatrixShadow
		D3DXMATRIX* WINAPI D3DXMatrixShadow( D3DXMATRIX *pOut, CONST D3DXVECTOR4 *pLight, CONST D3DXPLANE *pPlane )
		{
			return fn::D3DXMatrixShadow( pOut, pLight, pPlane );
		}

		// D3DXMatrixReflect
		D3DXMATRIX* WINAPI D3DXMatrixReflect( D3DXMATRIX *pOut, CONST D3DXPLANE *pPlane )
		{
			return fn::D3DXMatrixReflect( pOut, pPlane );
		}

		// D3DXQuaternionToAxisAngle
		void WINAPI D3DXQuaternionToAxisAngle( CONST D3DXQUATERNION *pQ, D3DXVECTOR3 *pAxis, FLOAT *pAngle )
		{
			return fn::D3DXQuaternionToAxisAngle( pQ, pAxis, pAngle );
		}

		// D3DXQuaternionRotationMatrix
		D3DXQUATERNION* WINAPI D3DXQuaternionRotationMatrix( D3DXQUATERNION *pOut, CONST D3DXMATRIX *pM )
		{
			return fn::D3DXQuaternionRotationMatrix( pOut, pM );
		}

		// D3DXQuaternionRotationAxis
		D3DXQUATERNION* WINAPI D3DXQuaternionRotationAxis( D3DXQUATERNION *pOut, CONST D3DXVECTOR3 *pV, FLOAT Angle )
		{
			return fn::D3DXQuaternionRotationAxis( pOut, pV, Angle );
		}

		// D3DXQuaternionRotationYawPitchRoll
		D3DXQUATERNION* WINAPI D3DXQuaternionRotationYawPitchRoll( D3DXQUATERNION *pOut, FLOAT Yaw, FLOAT Pitch, FLOAT Roll )
		{
			return fn::D3DXQuaternionRotationYawPitchRoll( pOut, Yaw, Pitch, Roll );
		}

		// D3DXQuaternionMultiply
		D3DXQUATERNION* WINAPI D3DXQuaternionMultiply( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1, CONST D3DXQUATERNION *pQ2 )
		{
			return fn::D3DXQuaternionMultiply( pOut, pQ1, pQ2 );
		}

		// D3DXQuaternionNormalize
		D3DXQUATERNION* WINAPI D3DXQuaternionNormalize( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ )
		{
			return fn::D3DXQuaternionNormalize( pOut, pQ );
		}

		// D3DXQuaternionInverse
		D3DXQUATERNION* WINAPI D3DXQuaternionInverse( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ )
		{
			return fn::D3DXQuaternionInverse( pOut, pQ );
		}

		// D3DXQuaternionLn
		D3DXQUATERNION* WINAPI D3DXQuaternionLn( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ )
		{
			return fn::D3DXQuaternionLn( pOut, pQ );
		}

		// D3DXQuaternionExp
		D3DXQUATERNION* WINAPI D3DXQuaternionExp( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ )
		{
			return fn::D3DXQuaternionExp( pOut, pQ );
		}

		// D3DXQuaternionSlerp
		D3DXQUATERNION* WINAPI D3DXQuaternionSlerp( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1, CONST D3DXQUATERNION *pQ2, FLOAT t )
		{
			return fn::D3DXQuaternionSlerp( pOut, pQ1, pQ2, t );
		}

		// D3DXQuaternionSquad
		D3DXQUATERNION* WINAPI D3DXQuaternionSquad( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1, CONST D3DXQUATERNION *pA, CONST D3DXQUATERNION *pB, CONST D3DXQUATERNION *pC, FLOAT t )
		{
			return fn::D3DXQuaternionSquad( pOut, pQ1, pA, pB, pC, t );
		}

		// D3DXQuaternionSquadSetup
		void WINAPI D3DXQuaternionSquadSetup( D3DXQUATERNION *pAOut, D3DXQUATERNION *pBOut, D3DXQUATERNION *pCOut, CONST D3DXQUATERNION *pQ0, CONST D3DXQUATERNION *pQ1, CONST D3DXQUATERNION *pQ2, CONST D3DXQUATERNION *pQ3 )
		{
			return fn::D3DXQuaternionSquadSetup( pAOut, pBOut, pCOut, pQ0, pQ1, pQ2, pQ3 );
		}

		// D3DXQuaternionBaryCentric
		D3DXQUATERNION* WINAPI D3DXQuaternionBaryCentric( D3DXQUATERNION *pOut, CONST D3DXQUATERNION *pQ1, CONST D3DXQUATERNION *pQ2, CONST D3DXQUATERNION *pQ3, FLOAT f, FLOAT g )
		{
			return fn::D3DXQuaternionBaryCentric( pOut, pQ1, pQ2, pQ3, f, g );
		}

		// D3DXPlaneNormalize
		D3DXPLANE* WINAPI D3DXPlaneNormalize( D3DXPLANE *pOut, CONST D3DXPLANE *pP )
		{
			return fn::D3DXPlaneNormalize( pOut, pP );
		}

		// D3DXPlaneIntersectLine
		D3DXVECTOR3* WINAPI D3DXPlaneIntersectLine( D3DXVECTOR3 *pOut, CONST D3DXPLANE *pP, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2 )
		{
			return fn::D3DXPlaneIntersectLine( pOut, pP, pV1, pV2 );
		}

		// D3DXPlaneFromPointNormal
		D3DXPLANE* WINAPI D3DXPlaneFromPointNormal( D3DXPLANE *pOut, CONST D3DXVECTOR3 *pPoint, CONST D3DXVECTOR3 *pNormal )
		{
			return fn::D3DXPlaneFromPointNormal( pOut, pPoint, pNormal );
		}

		// D3DXPlaneFromPoints
		D3DXPLANE* WINAPI D3DXPlaneFromPoints( D3DXPLANE *pOut, CONST D3DXVECTOR3 *pV1, CONST D3DXVECTOR3 *pV2, CONST D3DXVECTOR3 *pV3 )
		{
			return fn::D3DXPlaneFromPoints( pOut, pV1, pV2, pV3 );
		}

		// D3DXPlaneTransform
		D3DXPLANE* WINAPI D3DXPlaneTransform( D3DXPLANE *pOut, CONST D3DXPLANE *pP, CONST D3DXMATRIX *pM )
		{
			return fn::D3DXPlaneTransform( pOut, pP, pM );
		}

		// D3DXPlaneTransformArray
		D3DXPLANE* WINAPI D3DXPlaneTransformArray( D3DXPLANE *pOut, UINT OutStride, CONST D3DXPLANE *pP, UINT PStride, CONST D3DXMATRIX *pM, UINT n )
		{
			return fn::D3DXPlaneTransformArray( pOut, OutStride, pP, PStride, pM, n );
		}

		// D3DXColorAdjustSaturation
		D3DXCOLOR* WINAPI D3DXColorAdjustSaturation( D3DXCOLOR *pOut, CONST D3DXCOLOR *pC, FLOAT s )
		{
			return fn::D3DXColorAdjustSaturation( pOut, pC, s );
		}

		// D3DXColorAdjustContrast
		D3DXCOLOR* WINAPI D3DXColorAdjustContrast( D3DXCOLOR *pOut, CONST D3DXCOLOR *pC, FLOAT c )
		{
			return fn::D3DXColorAdjustContrast( pOut, pC, c );
		}

		// D3DXFresnelTerm
		FLOAT WINAPI D3DXFresnelTerm( FLOAT CosTheta, FLOAT RefractionIndex )
		{
			return fn::D3DXFresnelTerm( CosTheta, RefractionIndex );
		}

		// D3DXCreateMatrixStack
		HRESULT WINAPI D3DXCreateMatrixStack( DWORD Flags, LPD3DXMATRIXSTACK* ppStack )
		{
			return fn::D3DXCreateMatrixStack( Flags, ppStack );
		}

		// D3DXSHEvalDirection
		FLOAT* WINAPI D3DXSHEvalDirection( FLOAT *pOut, UINT Order, CONST D3DXVECTOR3 *pDir )
		{
			return fn::D3DXSHEvalDirection( pOut, Order, pDir );
		}

		// D3DXSHRotate
		FLOAT* WINAPI D3DXSHRotate( FLOAT *pOut, UINT Order, CONST D3DXMATRIX *pMatrix, CONST FLOAT *pIn )
		{
			return fn::D3DXSHRotate( pOut, Order, pMatrix, pIn );
		}

		// D3DXSHRotateZ
		FLOAT* WINAPI D3DXSHRotateZ( FLOAT *pOut, UINT Order, FLOAT Angle, CONST FLOAT *pIn )
		{
			return fn::D3DXSHRotateZ( pOut, Order, Angle, pIn );
		}

		// D3DXSHAdd
		FLOAT* WINAPI D3DXSHAdd( FLOAT *pOut, UINT Order, CONST FLOAT *pA, CONST FLOAT *pB )
		{
			return fn::D3DXSHAdd( pOut, Order, pA, pB );
		}

		// D3DXSHScale
		FLOAT* WINAPI D3DXSHScale( FLOAT *pOut, UINT Order, CONST FLOAT *pIn, CONST FLOAT Scale )
		{
			return fn::D3DXSHScale( pOut, Order, pIn, Scale );
		}

		// D3DXSHDot
		FLOAT WINAPI D3DXSHDot( UINT Order, CONST FLOAT *pA, CONST FLOAT *pB )
		{
			return fn::D3DXSHDot( Order, pA, pB );
		}

		// D3DXSHMultiply2
		FLOAT* WINAPI D3DXSHMultiply2( FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG )
		{
			return fn::D3DXSHMultiply2( pOut, pF, pG );
		}

		// D3DXSHMultiply3
		FLOAT* WINAPI D3DXSHMultiply3( FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG )
		{
			return fn::D3DXSHMultiply3( pOut, pF, pG );
		}

		// D3DXSHMultiply4
		FLOAT* WINAPI D3DXSHMultiply4( FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG )
		{
			return fn::D3DXSHMultiply4( pOut, pF, pG );
		}

		// D3DXSHMultiply5
		FLOAT* WINAPI D3DXSHMultiply5( FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG )
		{
			return fn::D3DXSHMultiply5( pOut, pF, pG );
		}

		// D3DXSHMultiply6
		FLOAT* WINAPI D3DXSHMultiply6( FLOAT *pOut, CONST FLOAT *pF, CONST FLOAT *pG )
		{
			return fn::D3DXSHMultiply6( pOut, pF, pG );
		}

		// D3DXSHEvalDirectionalLight
		HRESULT WINAPI D3DXSHEvalDirectionalLight( UINT Order, CONST D3DXVECTOR3 *pDir, FLOAT RIntensity, FLOAT GIntensity, FLOAT BIntensity, FLOAT *pROut, FLOAT *pGOut, FLOAT *pBOut )
		{
			return fn::D3DXSHEvalDirectionalLight( Order, pDir, RIntensity, GIntensity, BIntensity, pROut, pGOut, pBOut );
		}

		// D3DXSHEvalSphericalLight
		HRESULT WINAPI D3DXSHEvalSphericalLight( UINT Order, CONST D3DXVECTOR3 *pPos, FLOAT Radius, FLOAT RIntensity, FLOAT GIntensity, FLOAT BIntensity, FLOAT *pROut, FLOAT *pGOut, FLOAT *pBOut )
		{
			return fn::D3DXSHEvalSphericalLight( Order, pPos, Radius, RIntensity, GIntensity, BIntensity, pROut, pGOut, pBOut );
		}

		// D3DXSHEvalConeLight
		HRESULT WINAPI D3DXSHEvalConeLight( UINT Order, CONST D3DXVECTOR3 *pDir, FLOAT Radius, FLOAT RIntensity, FLOAT GIntensity, FLOAT BIntensity, FLOAT *pROut, FLOAT *pGOut, FLOAT *pBOut )
		{
			return fn::D3DXSHEvalConeLight( Order, pDir, Radius, RIntensity, GIntensity, BIntensity, pROut, pGOut, pBOut );
		}

		// D3DXSHEvalHemisphereLight
		HRESULT WINAPI D3DXSHEvalHemisphereLight( UINT Order, CONST D3DXVECTOR3 *pDir, D3DXCOLOR Top, D3DXCOLOR Bottom, FLOAT *pROut, FLOAT *pGOut, FLOAT *pBOut )
		{
			return fn::D3DXSHEvalHemisphereLight( Order, pDir, Top, Bottom, pROut, pGOut, pBOut );
		}

		// D3DXSHProjectCubeMap
		HRESULT WINAPI D3DXSHProjectCubeMap( UINT uOrder, LPDIRECT3DCUBETEXTURE9 pCubeMap, FLOAT *pROut, FLOAT *pGOut, FLOAT *pBOut )
		{
			return fn::D3DXSHProjectCubeMap( uOrder, pCubeMap, pROut, pGOut, pBOut );
		}

		// D3DXCreateSprite
		HRESULT WINAPI D3DXCreateSprite( LPDIRECT3DDEVICE9 pDevice, LPD3DXSPRITE* ppSprite )
		{
			return fn::D3DXCreateSprite( pDevice, ppSprite );
		}

		// D3DXCreateFont
		HRESULT WINAPI D3DXCreateFont( LPDIRECT3DDEVICE9 pDevice, INT Height, UINT Width, UINT Weight, UINT MipLevels, BOOL Italic, DWORD CharSet, DWORD OutputPrecision, DWORD Quality, DWORD PitchAndFamily, LPCWSTR pFaceName, LPD3DXFONT* ppFont )
		{
			return fn::D3DXCreateFont( pDevice, Height, Width, Weight, MipLevels, Italic, CharSet, OutputPrecision, Quality, PitchAndFamily, pFaceName, ppFont );
		}

		// D3DXCreateFontIndirect
		HRESULT WINAPI D3DXCreateFontIndirect( LPDIRECT3DDEVICE9 pDevice, CONST D3DXFONT_DESC* pDesc, LPD3DXFONT* ppFont )
		{
			return fn::D3DXCreateFontIndirect( pDevice, pDesc, ppFont );
		}

		// D3DXCreateRenderToSurface
		HRESULT WINAPI D3DXCreateRenderToSurface( LPDIRECT3DDEVICE9 pDevice, UINT Width, UINT Height, D3DFORMAT Format, BOOL DepthStencil, D3DFORMAT DepthStencilFormat, LPD3DXRENDERTOSURFACE* ppRenderToSurface )
		{
			return fn::D3DXCreateRenderToSurface( pDevice, Width, Height, Format, DepthStencil, DepthStencilFormat, ppRenderToSurface );
		}

		// D3DXCreateRenderToEnvMap
		HRESULT WINAPI D3DXCreateRenderToEnvMap( LPDIRECT3DDEVICE9 pDevice, UINT Size, UINT MipLevels, D3DFORMAT Format, BOOL DepthStencil, D3DFORMAT DepthStencilFormat, LPD3DXRenderToEnvMap* ppRenderToEnvMap )
		{
			return fn::D3DXCreateRenderToEnvMap( pDevice, Size, MipLevels, Format, DepthStencil, DepthStencilFormat, ppRenderToEnvMap );
		}

		// D3DXCreateLine
		HRESULT WINAPI D3DXCreateLine( LPDIRECT3DDEVICE9 pDevice, LPD3DXLINE* ppLine )
		{
			return fn::D3DXCreateLine( pDevice, ppLine );
		}

		// D3DXAssembleShaderFromFile
		HRESULT WINAPI D3DXAssembleShaderFromFile( LPCWSTR pSrcFile, CONST D3DXMACRO* pDefines, LPD3DXINCLUDE pInclude, DWORD Flags, LPD3DXBUFFER* ppShader, LPD3DXBUFFER* ppErrorMsgs )
		{
			return fn::D3DXAssembleShaderFromFile( pSrcFile, pDefines, pInclude, Flags, ppShader, ppErrorMsgs );
		}

		// D3DXAssembleShader
		HRESULT WINAPI D3DXAssembleShader( LPCSTR pSrcData, UINT SrcDataLen, CONST D3DXMACRO* pDefines, LPD3DXINCLUDE pInclude, DWORD Flags, LPD3DXBUFFER* ppShader, LPD3DXBUFFER* ppErrorMsgs )
		{
			return fn::D3DXAssembleShader( pSrcData, SrcDataLen, pDefines, pInclude, Flags, ppShader, ppErrorMsgs );
		}

		// D3DXCompileShaderFromFile
		HRESULT WINAPI D3DXCompileShaderFromFile( LPCWSTR pSrcFile, CONST D3DXMACRO* pDefines, LPD3DXINCLUDE pInclude, LPCSTR pFunctionName, LPCSTR pProfile, DWORD Flags, LPD3DXBUFFER* ppShader, LPD3DXBUFFER* ppErrorMsgs, LPD3DXCONSTANTTABLE* ppConstantTable )
		{
			return fn::D3DXCompileShaderFromFile( pSrcFile, pDefines, pInclude, pFunctionName, pProfile, Flags, ppShader, ppErrorMsgs, ppConstantTable );
		}

		// D3DXCompileShader
		HRESULT WINAPI D3DXCompileShader( LPCSTR pSrcData, UINT SrcDataLen, CONST D3DXMACRO* pDefines, LPD3DXINCLUDE pInclude, LPCSTR pFunctionName, LPCSTR pProfile, DWORD Flags, LPD3DXBUFFER* ppShader, LPD3DXBUFFER* ppErrorMsgs, LPD3DXCONSTANTTABLE* ppConstantTable )
		{
			return fn::D3DXCompileShader( pSrcData, SrcDataLen, pDefines, pInclude, pFunctionName, pProfile, Flags, ppShader, ppErrorMsgs, ppConstantTable );
		}

		// D3DXDisassembleShader
		HRESULT WINAPI D3DXDisassembleShader( CONST DWORD* pShader, BOOL EnableColorCode, LPCSTR pComments, LPD3DXBUFFER* ppDisassembly )
		{
			return fn::D3DXDisassembleShader( pShader, EnableColorCode, pComments, ppDisassembly );
		}

		// D3DXGetPixelShaderProfile
		LPCSTR WINAPI D3DXGetPixelShaderProfile( LPDIRECT3DDEVICE9 pDevice )
		{
			return fn::D3DXGetPixelShaderProfile( pDevice );
		}

		// D3DXGetVertexShaderProfile
		LPCSTR WINAPI D3DXGetVertexShaderProfile( LPDIRECT3DDEVICE9 pDevice )
		{
			return fn::D3DXGetVertexShaderProfile( pDevice );
		}

		// D3DXFindShaderComment
		HRESULT WINAPI D3DXFindShaderComment( CONST DWORD* pFunction, DWORD FourCC, LPCVOID* ppData, UINT* pSizeInBytes )
		{
			return fn::D3DXFindShaderComment( pFunction, FourCC, ppData, pSizeInBytes );
		}

		// D3DXGetShaderSize
		UINT WINAPI D3DXGetShaderSize( CONST DWORD* pFunction )
		{
			return fn::D3DXGetShaderSize( pFunction );
		}

		// D3DXGetShaderVersion
		DWORD WINAPI D3DXGetShaderVersion( CONST DWORD* pFunction )
		{
			return fn::D3DXGetShaderVersion( pFunction );
		}

		// D3DXGetShaderInputSemantics
		HRESULT WINAPI D3DXGetShaderInputSemantics( CONST DWORD* pFunction, D3DXSEMANTIC* pSemantics, UINT* pCount )
		{
			return fn::D3DXGetShaderInputSemantics( pFunction, pSemantics, pCount );
		}

		// D3DXGetShaderOutputSemantics
		HRESULT WINAPI D3DXGetShaderOutputSemantics( CONST DWORD* pFunction, D3DXSEMANTIC* pSemantics, UINT* pCount )
		{
			return fn::D3DXGetShaderOutputSemantics( pFunction, pSemantics, pCount );
		}

		// D3DXGetShaderSamplers
		HRESULT WINAPI D3DXGetShaderSamplers( CONST DWORD* pFunction, LPCSTR* pSamplers, UINT* pCount )
		{
			return fn::D3DXGetShaderSamplers( pFunction, pSamplers, pCount );
		}

		// D3DXGetShaderConstantTable
		HRESULT WINAPI D3DXGetShaderConstantTable( CONST DWORD* pFunction, LPD3DXCONSTANTTABLE* ppConstantTable )
		{
			return fn::D3DXGetShaderConstantTable( pFunction, ppConstantTable );
		}

		// D3DXGetShaderConstantTableEx
		HRESULT WINAPI D3DXGetShaderConstantTableEx( CONST DWORD* pFunction, DWORD Flags, LPD3DXCONSTANTTABLE* ppConstantTable )
		{
			return fn::D3DXGetShaderConstantTableEx( pFunction, Flags, ppConstantTable );
		}

		// D3DXCreateTextureShader
		HRESULT WINAPI D3DXCreateTextureShader( CONST DWORD* pFunction, LPD3DXTEXTURESHADER* ppTextureShader )
		{
			return fn::D3DXCreateTextureShader( pFunction, ppTextureShader );
		}

		// D3DXGatherFragmentsFromFile
		HRESULT WINAPI D3DXGatherFragmentsFromFile( LPCWSTR pSrcFile, CONST D3DXMACRO* pDefines, LPD3DXINCLUDE pInclude, DWORD Flags, LPD3DXBUFFER* ppShader, LPD3DXBUFFER* ppErrorMsgs )
		{
			return fn::D3DXGatherFragmentsFromFile( pSrcFile, pDefines, pInclude, Flags, ppShader, ppErrorMsgs );
		}

		// D3DXGatherFragments
		HRESULT WINAPI D3DXGatherFragments( LPCSTR pSrcData, UINT SrcDataLen, CONST D3DXMACRO* pDefines, LPD3DXINCLUDE pInclude, DWORD Flags, LPD3DXBUFFER* ppShader, LPD3DXBUFFER* ppErrorMsgs )
		{
			return fn::D3DXGatherFragments( pSrcData, SrcDataLen, pDefines, pInclude, Flags, ppShader, ppErrorMsgs );
		}

		// D3DXCreateFragmentLinker
		HRESULT WINAPI D3DXCreateFragmentLinker( LPDIRECT3DDEVICE9 pDevice, UINT ShaderCacheSize, LPD3DXFRAGMENTLINKER* ppFragmentLinker )
		{
			return fn::D3DXCreateFragmentLinker( pDevice, ShaderCacheSize, ppFragmentLinker );
		}

		// D3DXCreateFragmentLinkerEx
		HRESULT WINAPI D3DXCreateFragmentLinkerEx( LPDIRECT3DDEVICE9 pDevice, UINT ShaderCacheSize, DWORD Flags, LPD3DXFRAGMENTLINKER* ppFragmentLinker )
		{
			return fn::D3DXCreateFragmentLinkerEx( pDevice, ShaderCacheSize, Flags, ppFragmentLinker );
		}

		// D3DXPreprocessShaderFromFile
		HRESULT WINAPI D3DXPreprocessShaderFromFile( LPCWSTR pSrcFile, CONST D3DXMACRO* pDefines, LPD3DXINCLUDE pInclude, LPD3DXBUFFER* ppShaderText, LPD3DXBUFFER* ppErrorMsgs )
		{
			return fn::D3DXPreprocessShaderFromFile( pSrcFile, pDefines, pInclude, ppShaderText, ppErrorMsgs );
		}

		// D3DXPreprocessShader
		HRESULT WINAPI D3DXPreprocessShader( LPCSTR pSrcData, UINT SrcDataSize, CONST D3DXMACRO* pDefines, LPD3DXINCLUDE pInclude, LPD3DXBUFFER* ppShaderText, LPD3DXBUFFER* ppErrorMsgs )
		{
			return fn::D3DXPreprocessShader( pSrcData, SrcDataSize, pDefines, pInclude, ppShaderText, ppErrorMsgs );
		}

		// D3DXCreateEffectPool
		HRESULT WINAPI D3DXCreateEffectPool( LPD3DXEFFECTPOOL* ppPool )
		{
			return fn::D3DXCreateEffectPool( ppPool );
		}

		// D3DXCreateEffectFromFile
		HRESULT WINAPI D3DXCreateEffectFromFile( LPDIRECT3DDEVICE9 pDevice, LPCWSTR pSrcFile, CONST D3DXMACRO* pDefines, LPD3DXINCLUDE pInclude, DWORD Flags, LPD3DXEFFECTPOOL pPool, LPD3DXEFFECT* ppEffect, LPD3DXBUFFER* ppCompilationErrors )
		{
			return fn::D3DXCreateEffectFromFile( pDevice, pSrcFile, pDefines, pInclude, Flags, pPool, ppEffect, ppCompilationErrors );
		}

		// D3DXCreateEffect
		HRESULT WINAPI D3DXCreateEffect( LPDIRECT3DDEVICE9 pDevice, LPCVOID pSrcData, UINT SrcDataLen, CONST D3DXMACRO* pDefines, LPD3DXINCLUDE pInclude, DWORD Flags, LPD3DXEFFECTPOOL pPool, LPD3DXEFFECT* ppEffect, LPD3DXBUFFER* ppCompilationErrors )
		{
			return fn::D3DXCreateEffect( pDevice, pSrcData, SrcDataLen, pDefines, pInclude, Flags, pPool, ppEffect, ppCompilationErrors );
		}

		// D3DXCreateEffectFromFileEx
		HRESULT WINAPI D3DXCreateEffectFromFileEx( LPDIRECT3DDEVICE9 pDevice, LPCWSTR pSrcFile, CONST D3DXMACRO* pDefines, LPD3DXINCLUDE pInclude, LPCSTR pSkipConstants, DWORD Flags, LPD3DXEFFECTPOOL pPool, LPD3DXEFFECT* ppEffect, LPD3DXBUFFER* ppCompilationErrors )
		{
			return fn::D3DXCreateEffectFromFileEx( pDevice, pSrcFile, pDefines, pInclude, pSkipConstants, Flags, pPool, ppEffect, ppCompilationErrors );
		}

		// D3DXCreateEffectEx
		HRESULT WINAPI D3DXCreateEffectEx( LPDIRECT3DDEVICE9 pDevice, LPCVOID pSrcData, UINT SrcDataLen, CONST D3DXMACRO* pDefines, LPD3DXINCLUDE pInclude, LPCSTR pSkipConstants, DWORD Flags, LPD3DXEFFECTPOOL pPool, LPD3DXEFFECT* ppEffect, LPD3DXBUFFER* ppCompilationErrors )
		{
			return fn::D3DXCreateEffectEx( pDevice, pSrcData, SrcDataLen, pDefines, pInclude, pSkipConstants, Flags, pPool, ppEffect, ppCompilationErrors );
		}

		// D3DXCreateEffectCompilerFromFile
		HRESULT WINAPI D3DXCreateEffectCompilerFromFile( LPCWSTR pSrcFile, CONST D3DXMACRO* pDefines, LPD3DXINCLUDE pInclude, DWORD Flags, LPD3DXEFFECTCOMPILER* ppCompiler, LPD3DXBUFFER* ppParseErrors )
		{
			return fn::D3DXCreateEffectCompilerFromFile( pSrcFile, pDefines, pInclude, Flags, ppCompiler, ppParseErrors );
		}

		// D3DXCreateEffectCompiler
		HRESULT WINAPI D3DXCreateEffectCompiler( LPCSTR pSrcData, UINT SrcDataLen, CONST D3DXMACRO* pDefines, LPD3DXINCLUDE pInclude, DWORD Flags, LPD3DXEFFECTCOMPILER* ppCompiler, LPD3DXBUFFER* ppParseErrors )
		{
			return fn::D3DXCreateEffectCompiler( pSrcData, SrcDataLen, pDefines, pInclude, Flags, ppCompiler, ppParseErrors );
		}

		// D3DXDisassembleEffect
		HRESULT WINAPI D3DXDisassembleEffect( LPD3DXEFFECT pEffect, BOOL EnableColorCode, LPD3DXBUFFER *ppDisassembly )
		{
			return fn::D3DXDisassembleEffect( pEffect, EnableColorCode, ppDisassembly );
		}

		// D3DXGetImageInfoFromFile
		HRESULT WINAPI D3DXGetImageInfoFromFile( LPCWSTR pSrcFile, D3DXIMAGE_INFO* pSrcInfo )
		{
			return fn::D3DXGetImageInfoFromFile( pSrcFile, pSrcInfo );
		}

		// D3DXGetImageInfoFromFileInMemory
		HRESULT WINAPI D3DXGetImageInfoFromFileInMemory( LPCVOID pSrcData, UINT SrcDataSize, D3DXIMAGE_INFO* pSrcInfo )
		{
			return fn::D3DXGetImageInfoFromFileInMemory( pSrcData, SrcDataSize, pSrcInfo );
		}

		// D3DXLoadSurfaceFromFile
		HRESULT WINAPI D3DXLoadSurfaceFromFile( LPDIRECT3DSURFACE9 pDestSurface, CONST PALETTEENTRY* pDestPalette, CONST RECT* pDestRect, LPCWSTR pSrcFile, CONST RECT* pSrcRect, DWORD Filter, D3DCOLOR ColorKey, D3DXIMAGE_INFO* pSrcInfo )
		{
			return fn::D3DXLoadSurfaceFromFile( pDestSurface, pDestPalette, pDestRect, pSrcFile, pSrcRect, Filter, ColorKey, pSrcInfo );
		}

		// D3DXLoadSurfaceFromFileInMemory
		HRESULT WINAPI D3DXLoadSurfaceFromFileInMemory( LPDIRECT3DSURFACE9 pDestSurface, CONST PALETTEENTRY* pDestPalette, CONST RECT* pDestRect, LPCVOID pSrcData, UINT SrcDataSize, CONST RECT* pSrcRect, DWORD Filter, D3DCOLOR ColorKey, D3DXIMAGE_INFO* pSrcInfo )
		{
			return fn::D3DXLoadSurfaceFromFileInMemory( pDestSurface, pDestPalette, pDestRect, pSrcData, SrcDataSize, pSrcRect, Filter, ColorKey, pSrcInfo );
		}

		// D3DXLoadSurfaceFromSurface
		HRESULT WINAPI D3DXLoadSurfaceFromSurface( LPDIRECT3DSURFACE9 pDestSurface, CONST PALETTEENTRY* pDestPalette, CONST RECT* pDestRect, LPDIRECT3DSURFACE9 pSrcSurface, CONST PALETTEENTRY* pSrcPalette, CONST RECT* pSrcRect, DWORD Filter, D3DCOLOR ColorKey )
		{
			return fn::D3DXLoadSurfaceFromSurface( pDestSurface, pDestPalette, pDestRect, pSrcSurface, pSrcPalette, pSrcRect, Filter, ColorKey );
		}

		// D3DXLoadSurfaceFromMemory
		HRESULT WINAPI D3DXLoadSurfaceFromMemory( LPDIRECT3DSURFACE9 pDestSurface, CONST PALETTEENTRY* pDestPalette, CONST RECT* pDestRect, LPCVOID pSrcMemory, D3DFORMAT SrcFormat, UINT SrcPitch, CONST PALETTEENTRY* pSrcPalette, CONST RECT* pSrcRect, DWORD Filter, D3DCOLOR ColorKey )
		{
			return fn::D3DXLoadSurfaceFromMemory( pDestSurface, pDestPalette, pDestRect, pSrcMemory, SrcFormat, SrcPitch, pSrcPalette, pSrcRect, Filter, ColorKey );
		}

		// D3DXSaveSurfaceToFile
		HRESULT WINAPI D3DXSaveSurfaceToFile( LPCWSTR pDestFile, D3DXIMAGE_FILEFORMAT DestFormat, LPDIRECT3DSURFACE9 pSrcSurface, CONST PALETTEENTRY* pSrcPalette, CONST RECT* pSrcRect )
		{
			return fn::D3DXSaveSurfaceToFile( pDestFile, DestFormat, pSrcSurface, pSrcPalette, pSrcRect );
		}

		// D3DXSaveSurfaceToFileInMemory
		HRESULT WINAPI D3DXSaveSurfaceToFileInMemory( LPD3DXBUFFER* ppDestBuf, D3DXIMAGE_FILEFORMAT DestFormat, LPDIRECT3DSURFACE9 pSrcSurface, CONST PALETTEENTRY* pSrcPalette, CONST RECT* pSrcRect )
		{
			return fn::D3DXSaveSurfaceToFileInMemory( ppDestBuf, DestFormat, pSrcSurface, pSrcPalette, pSrcRect );
		}

		// D3DXLoadVolumeFromFile
		HRESULT WINAPI D3DXLoadVolumeFromFile( LPDIRECT3DVOLUME9 pDestVolume, CONST PALETTEENTRY* pDestPalette, CONST D3DBOX* pDestBox, LPCWSTR pSrcFile, CONST D3DBOX* pSrcBox, DWORD Filter, D3DCOLOR ColorKey, D3DXIMAGE_INFO* pSrcInfo )
		{
			return fn::D3DXLoadVolumeFromFile( pDestVolume, pDestPalette, pDestBox, pSrcFile, pSrcBox, Filter, ColorKey, pSrcInfo );
		}

		// D3DXLoadVolumeFromFileInMemory
		HRESULT WINAPI D3DXLoadVolumeFromFileInMemory( LPDIRECT3DVOLUME9 pDestVolume, CONST PALETTEENTRY* pDestPalette, CONST D3DBOX* pDestBox, LPCVOID pSrcData, UINT SrcDataSize, CONST D3DBOX* pSrcBox, DWORD Filter, D3DCOLOR ColorKey, D3DXIMAGE_INFO* pSrcInfo )
		{
			return fn::D3DXLoadVolumeFromFileInMemory( pDestVolume, pDestPalette, pDestBox, pSrcData, SrcDataSize, pSrcBox, Filter, ColorKey, pSrcInfo );
		}

		// D3DXLoadVolumeFromVolume
		HRESULT WINAPI D3DXLoadVolumeFromVolume( LPDIRECT3DVOLUME9 pDestVolume, CONST PALETTEENTRY* pDestPalette, CONST D3DBOX* pDestBox, LPDIRECT3DVOLUME9 pSrcVolume, CONST PALETTEENTRY* pSrcPalette, CONST D3DBOX* pSrcBox, DWORD Filter, D3DCOLOR ColorKey )
		{
			return fn::D3DXLoadVolumeFromVolume( pDestVolume, pDestPalette, pDestBox, pSrcVolume, pSrcPalette, pSrcBox, Filter, ColorKey );
		}

		// D3DXSaveVolumeToFile
		HRESULT WINAPI D3DXSaveVolumeToFile( LPCWSTR pDestFile, D3DXIMAGE_FILEFORMAT DestFormat, LPDIRECT3DVOLUME9 pSrcVolume, CONST PALETTEENTRY* pSrcPalette, CONST D3DBOX* pSrcBox )
		{
			return fn::D3DXSaveVolumeToFile( pDestFile, DestFormat, pSrcVolume, pSrcPalette, pSrcBox );
		}

		// D3DXSaveVolumeToFileInMemory
		HRESULT WINAPI D3DXSaveVolumeToFileInMemory( LPD3DXBUFFER* ppDestBuf, D3DXIMAGE_FILEFORMAT DestFormat, LPDIRECT3DVOLUME9 pSrcVolume, CONST PALETTEENTRY* pSrcPalette, CONST D3DBOX* pSrcBox )
		{
			return fn::D3DXSaveVolumeToFileInMemory( ppDestBuf, DestFormat, pSrcVolume, pSrcPalette, pSrcBox );
		}

		// D3DXCheckTextureRequirements
		HRESULT WINAPI D3DXCheckTextureRequirements( LPDIRECT3DDEVICE9 pDevice, UINT* pWidth, UINT* pHeight, UINT* pNumMipLevels, DWORD Usage, D3DFORMAT* pFormat, D3DPOOL Pool )
		{
			return fn::D3DXCheckTextureRequirements( pDevice, pWidth, pHeight, pNumMipLevels, Usage, pFormat, Pool );
		}

		// D3DXCheckCubeTextureRequirements
		HRESULT WINAPI D3DXCheckCubeTextureRequirements( LPDIRECT3DDEVICE9 pDevice, UINT* pSize, UINT* pNumMipLevels, DWORD Usage, D3DFORMAT* pFormat, D3DPOOL Pool )
		{
			return fn::D3DXCheckCubeTextureRequirements( pDevice, pSize, pNumMipLevels, Usage, pFormat, Pool );
		}

		// D3DXCheckVolumeTextureRequirements
		HRESULT WINAPI D3DXCheckVolumeTextureRequirements( LPDIRECT3DDEVICE9 pDevice, UINT* pWidth, UINT* pHeight, UINT* pDepth, UINT* pNumMipLevels, DWORD Usage, D3DFORMAT* pFormat, D3DPOOL Pool )
		{
			return fn::D3DXCheckVolumeTextureRequirements( pDevice, pWidth, pHeight, pDepth, pNumMipLevels, Usage, pFormat, Pool );
		}

		// D3DXCreateTexture
		HRESULT WINAPI D3DXCreateTexture( LPDIRECT3DDEVICE9 pDevice, UINT Width, UINT Height, UINT MipLevels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, LPDIRECT3DTEXTURE9* ppTexture )
		{
			return fn::D3DXCreateTexture( pDevice, Width, Height, MipLevels, Usage, Format, Pool, ppTexture );
		}

		// D3DXCreateCubeTexture
		HRESULT WINAPI D3DXCreateCubeTexture( LPDIRECT3DDEVICE9 pDevice, UINT Size, UINT MipLevels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, LPDIRECT3DCUBETEXTURE9* ppCubeTexture )
		{
			return fn::D3DXCreateCubeTexture( pDevice, Size, MipLevels, Usage, Format, Pool, ppCubeTexture );
		}

		// D3DXCreateVolumeTexture
		HRESULT WINAPI D3DXCreateVolumeTexture( LPDIRECT3DDEVICE9 pDevice, UINT Width, UINT Height, UINT Depth, UINT MipLevels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture )
		{
			return fn::D3DXCreateVolumeTexture( pDevice, Width, Height, Depth, MipLevels, Usage, Format, Pool, ppVolumeTexture );
		}

		// D3DXCreateTextureFromFile
		HRESULT WINAPI D3DXCreateTextureFromFile( LPDIRECT3DDEVICE9 pDevice, LPCWSTR pSrcFile, LPDIRECT3DTEXTURE9* ppTexture )
		{
			return fn::D3DXCreateTextureFromFile( pDevice, pSrcFile, ppTexture );
		}

		// D3DXCreateTextureFromFileInMemory
		HRESULT WINAPI D3DXCreateTextureFromFileInMemory( LPDIRECT3DDEVICE9 pDevice, LPCVOID pSrcData, UINT SrcDataSize, LPDIRECT3DTEXTURE9* ppTexture )
		{
			return fn::D3DXCreateTextureFromFileInMemory( pDevice, pSrcData, SrcDataSize, ppTexture );
		}

		// D3DXCreateCubeTextureFromFile
		HRESULT WINAPI D3DXCreateCubeTextureFromFile( LPDIRECT3DDEVICE9 pDevice, LPCWSTR pSrcFile, LPDIRECT3DCUBETEXTURE9* ppCubeTexture )
		{
			return fn::D3DXCreateCubeTextureFromFile( pDevice, pSrcFile, ppCubeTexture );
		}

		// D3DXCreateCubeTextureFromFileInMemory
		HRESULT WINAPI D3DXCreateCubeTextureFromFileInMemory( LPDIRECT3DDEVICE9 pDevice, LPCVOID pSrcData, UINT SrcDataSize, LPDIRECT3DCUBETEXTURE9* ppCubeTexture )
		{
			return fn::D3DXCreateCubeTextureFromFileInMemory( pDevice, pSrcData, SrcDataSize, ppCubeTexture );
		}

		// D3DXCreateVolumeTextureFromFile
		HRESULT WINAPI D3DXCreateVolumeTextureFromFile( LPDIRECT3DDEVICE9 pDevice, LPCWSTR pSrcFile, LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture )
		{
			return fn::D3DXCreateVolumeTextureFromFile( pDevice, pSrcFile, ppVolumeTexture );
		}

		// D3DXCreateVolumeTextureFromFileInMemory
		HRESULT WINAPI D3DXCreateVolumeTextureFromFileInMemory( LPDIRECT3DDEVICE9 pDevice, LPCVOID pSrcData, UINT SrcDataSize, LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture )
		{
			return fn::D3DXCreateVolumeTextureFromFileInMemory( pDevice, pSrcData, SrcDataSize, ppVolumeTexture );
		}

		// D3DXCreateTextureFromFileEx
		HRESULT WINAPI D3DXCreateTextureFromFileEx( LPDIRECT3DDEVICE9 pDevice, LPCWSTR pSrcFile, UINT Width, UINT Height, UINT MipLevels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, DWORD Filter, DWORD MipFilter, D3DCOLOR ColorKey, D3DXIMAGE_INFO* pSrcInfo, PALETTEENTRY* pPalette, LPDIRECT3DTEXTURE9* ppTexture)
		{
			return fn::D3DXCreateTextureFromFileEx( pDevice, pSrcFile, Width, Height, MipLevels, Usage, Format, Pool, Filter, MipFilter, ColorKey, pSrcInfo, pPalette, ppTexture);
		}
		// D3DXCreateTextureFromFileInMemoryEx
		HRESULT WINAPI D3DXCreateTextureFromFileInMemoryEx( LPDIRECT3DDEVICE9 pDevice, LPCVOID pSrcData, UINT SrcDataSize, UINT Width, UINT Height, UINT MipLevels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, DWORD Filter, DWORD MipFilter, D3DCOLOR ColorKey, D3DXIMAGE_INFO* pSrcInfo, PALETTEENTRY* pPalette, LPDIRECT3DTEXTURE9* ppTexture )
		{
			return fn::D3DXCreateTextureFromFileInMemoryEx( pDevice, pSrcData, SrcDataSize, Width, Height, MipLevels, Usage, Format, Pool, Filter, MipFilter, ColorKey, pSrcInfo, pPalette, ppTexture );
		}

		// D3DXCreateCubeTextureFromFileEx
		HRESULT WINAPI D3DXCreateCubeTextureFromFileEx( LPDIRECT3DDEVICE9 pDevice, LPCTSTR pSrcFile, UINT Width, UINT Height, UINT MipLevels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, DWORD Filter, DWORD MipFilter, D3DCOLOR ColorKey, D3DXIMAGE_INFO * pSrcInfo, PALETTEENTRY * pPalette, LPDIRECT3DTEXTURE9 * ppTexture )
		{
			return fn::D3DXCreateCubeTextureFromFileEx( pDevice, pSrcFile, Width, Height, MipLevels, Usage, Format, Pool, Filter, MipFilter, ColorKey, pSrcInfo, pPalette, ppTexture );
		}

		// D3DXCreateCubeTextureFromFileInMemoryEx
		HRESULT WINAPI D3DXCreateCubeTextureFromFileInMemoryEx( LPDIRECT3DDEVICE9 pDevice, LPCVOID pSrcData, UINT SrcDataSize, UINT Size, UINT MipLevels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, DWORD Filter, DWORD MipFilter, D3DCOLOR ColorKey, D3DXIMAGE_INFO* pSrcInfo, PALETTEENTRY* pPalette, LPDIRECT3DCUBETEXTURE9* ppCubeTexture )
		{
			return fn::D3DXCreateCubeTextureFromFileInMemoryEx( pDevice, pSrcData, SrcDataSize, Size, MipLevels, Usage, Format, Pool, Filter, MipFilter, ColorKey, pSrcInfo, pPalette, ppCubeTexture );
		}

		// D3DXCreateVolumeTextureFromFileEx
		HRESULT WINAPI D3DXCreateVolumeTextureFromFileEx( LPDIRECT3DDEVICE9 pDevice, LPCWSTR pSrcFile, UINT Width, UINT Height, UINT Depth, UINT MipLevels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, DWORD Filter, DWORD MipFilter, D3DCOLOR ColorKey, D3DXIMAGE_INFO* pSrcInfo, PALETTEENTRY* pPalette, LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture )
		{
			return fn::D3DXCreateVolumeTextureFromFileEx( pDevice, pSrcFile, Width, Height, Depth, MipLevels, Usage, Format, Pool, Filter, MipFilter, ColorKey, pSrcInfo, pPalette, ppVolumeTexture );
		}

		// D3DXCreateVolumeTextureFromFileInMemoryEx
		HRESULT WINAPI D3DXCreateVolumeTextureFromFileInMemoryEx( LPDIRECT3DDEVICE9 pDevice, LPCVOID pSrcData, UINT SrcDataSize, UINT Width, UINT Height, UINT Depth, UINT MipLevels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, DWORD Filter, DWORD MipFilter, D3DCOLOR ColorKey, D3DXIMAGE_INFO* pSrcInfo, PALETTEENTRY* pPalette, LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture)
		{
			return fn::D3DXCreateVolumeTextureFromFileInMemoryEx( pDevice, pSrcData, SrcDataSize, Width, Height, Depth, MipLevels, Usage, Format, Pool, Filter, MipFilter, ColorKey, pSrcInfo, pPalette, ppVolumeTexture );
		}

		// D3DXSaveTextureToFile
		HRESULT WINAPI D3DXSaveTextureToFile( LPCWSTR pDestFile, D3DXIMAGE_FILEFORMAT DestFormat, LPDIRECT3DBASETEXTURE9 pSrcTexture, CONST PALETTEENTRY* pSrcPalette )
		{
			return fn::D3DXSaveTextureToFile( pDestFile, DestFormat, pSrcTexture, pSrcPalette );
		}

		// D3DXSaveTextureToFileInMemory
		HRESULT WINAPI D3DXSaveTextureToFileInMemory( LPD3DXBUFFER* ppDestBuf, D3DXIMAGE_FILEFORMAT DestFormat, LPDIRECT3DBASETEXTURE9 pSrcTexture, CONST PALETTEENTRY* pSrcPalette )
		{
			return fn::D3DXSaveTextureToFileInMemory( ppDestBuf, DestFormat, pSrcTexture, pSrcPalette );
		}

		// D3DXFilterTexture
		HRESULT WINAPI D3DXFilterTexture( LPDIRECT3DBASETEXTURE9 pBaseTexture, CONST PALETTEENTRY* pPalette, UINT SrcLevel, DWORD Filter )
		{
			return fn::D3DXFilterTexture( pBaseTexture, pPalette, SrcLevel, Filter );
		}

		// D3DXFillTexture
		HRESULT WINAPI D3DXFillTexture( LPDIRECT3DTEXTURE9 pTexture, LPD3DXFILL2D pFunction, LPVOID pData )
		{
			return fn::D3DXFillTexture( pTexture, pFunction, pData );
		}

		// D3DXFillCubeTexture
		HRESULT WINAPI D3DXFillCubeTexture( LPDIRECT3DCUBETEXTURE9 pCubeTexture, LPD3DXFILL3D pFunction, LPVOID pData )
		{
			return fn::D3DXFillCubeTexture( pCubeTexture, pFunction, pData );
		}

		// D3DXFillVolumeTexture
		HRESULT WINAPI D3DXFillVolumeTexture( LPDIRECT3DVOLUMETEXTURE9 pVolumeTexture, LPD3DXFILL3D pFunction, LPVOID pData )
		{
			return fn::D3DXFillVolumeTexture( pVolumeTexture, pFunction, pData );
		}

		// D3DXFillTextureTX
		HRESULT WINAPI D3DXFillTextureTX( LPDIRECT3DTEXTURE9 pTexture, LPD3DXTEXTURESHADER pTextureShader )
		{
			return fn::D3DXFillTextureTX( pTexture, pTextureShader );
		}

		// D3DXFillCubeTextureTX
		HRESULT WINAPI D3DXFillCubeTextureTX( LPDIRECT3DCUBETEXTURE9 pCubeTexture, LPD3DXTEXTURESHADER pTextureShader )
		{
			return fn::D3DXFillCubeTextureTX( pCubeTexture, pTextureShader );
		}

		// D3DXFillVolumeTextureTX
		HRESULT WINAPI D3DXFillVolumeTextureTX( LPDIRECT3DVOLUMETEXTURE9 pVolumeTexture, LPD3DXTEXTURESHADER pTextureShader )
		{
			return fn::D3DXFillVolumeTextureTX( pVolumeTexture, pTextureShader );
		}

		// D3DXComputeNormalMap
		HRESULT WINAPI D3DXComputeNormalMap( LPDIRECT3DTEXTURE9 pTexture, LPDIRECT3DTEXTURE9 pSrcTexture, CONST PALETTEENTRY* pSrcPalette, DWORD Flags, DWORD Channel, FLOAT Amplitude )
		{
			return fn::D3DXComputeNormalMap( pTexture, pSrcTexture, pSrcPalette, Flags, Channel, Amplitude );
		}
		
	} // namespace dx9

} // namespace xeres
